Simplify JDK and Maven installation and version upgrading.

java-tools.properties now defines versions in a machine readable format so that we can install these versions into the Docker image verify those versions in our release tooling to ensure the environment matches what we expect.

Closes #32
This commit is contained in:
Mark Paluch
2023-02-20 11:55:08 +01:00
parent d01285fb75
commit 651a76ac07
15 changed files with 394 additions and 51 deletions

32
ci/java-init.sh Executable file
View File

@@ -0,0 +1,32 @@
#!/bin/bash
####################################################################
# Utility to install Java and Maven into the build container image #
####################################################################
source $HOME/.sdkman/bin/sdkman-init.sh
JAVA_TOOLS_PROPERTIES=java-tools.properties
if [ ! -f ${JAVA_TOOLS_PROPERTIES} ]
then
echo "File does not exist: ${JAVA_TOOLS_PROPERTIES}"
exit 1
fi
while IFS='=' read -r key value
do
key=$(echo $key | tr '.' '_')
eval ${key}=\${value}
done < "${JAVA_TOOLS_PROPERTIES}"
IFS=', ' read -r -a jdk_versions <<< "$jdks"
for to_install in "${jdk_versions[@]}"
do
dist="${to_install}-tem"
echo "Installing JDK ${dist}"
yes | sdk install java "${dist}"
done
echo "Installing Maven ${maven}"
yes | sdk install maven ${maven}