Detect both Debian and Ubuntu when configuring java runtime parameters.
This works around a minor OS detection bugs that applies to Docker
containers. Also, improved the handling of an unset variable when
setting the java runtime. This reduces the likelihood of rewriting a
working variable with a broken one.
Change-Id: I69c0756d740430dabef823fa8eed8cbf67e343c6
Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
--- /dev/null
+---
+issues:
+ - |
+ Addresses problems found while troubleshooting IT-24352
+fixes:
+ - |
+ Added support for debian in update-java-alternatives.sh (addresses potential Ubuntu detection bug)
+ Safer handling of unset/null SONARCLOUD_JAVA_VERSION variable preventing java runtime issues
fi
fi
-if [ "$SET_JDK_VERSION" != "$SONARCLOUD_JAVA_VERSION" ]; then
+if [ -n "$SONARCLOUD_JAVA_VERSION" ] && [ "$SET_JDK_VERSION" != "$SONARCLOUD_JAVA_VERSION" ]; then
export SET_JDK_VERSION="$SONARCLOUD_JAVA_VERSION"
bash <(curl -s https://raw.githubusercontent.com/lfit/releng-global-jjb/master/shell/update-java-alternatives.sh)
source /tmp/java.env
echo "---> RedHat type system detected"
update-java-redhat
;;
- ubuntu)
- echo "---> Ubuntu system detected"
+ ubuntu|debian)
+ echo "---> Ubuntu/Debian system detected"
update-java-ubuntu
;;
esac