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:
32
ci/java-init.sh
Executable file
32
ci/java-init.sh
Executable 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}
|
||||
Reference in New Issue
Block a user