-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CHE-4865: Correctly detect installed java version #4870
Conversation
Tested with |
@@ -52,8 +52,8 @@ INSTALL_JDK=false | |||
command -v ${JAVA_HOME}/bin/java >/dev/null 2>&1 || { | |||
INSTALL_JDK=true; | |||
} && { | |||
java_version=$(${JAVA_HOME}/bin/java -version 2>&1 | sed 's/.* version "\\(.*\\)\\.\\(.*\\)\\..*"/\\1\\2/; 1q') | |||
if [ ! -z "${java_version##*[!0-9]*}" ] && [ "${java_version}" -lt "18" ]; then | |||
java_version=$(${JAVA_HOME}/bin/java -version 2>&1 | grep version | awk '{print $NF}' | sed 's/"//g' | cut -d '.' -f2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no checks that awk is present in container. awk is used in centos check, so I supose in works on centos but how to be sure it works in other images?.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried ubuntu, debian and alpine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about user's custom images? Have we declared that awk is mandatory in dev machine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Library images for alpine, busybox, ubuntu, debian, centos, fedora and rhel have awk.
Also, in all other agents we use awk - so far so good. So, if we are to check if awk is available, then we should do it across all agent scripts. However, having a custom image without awk is quite uncommon I think (maybe some super stripped images)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok then
Build success. https://ci.codenvycorp.com/job/che-pullrequests-build/2477/ |
* CHE-4865: Correctly detect installed java version * Fix up
What does this PR do?
Correctly detect installed java version
What issues does this PR fix or reference?
#4865
Changelog
Correctly detect installed java version
Release Notes
not required
Docs PR
not required