Skip to content
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

Merged
2 commits merged into from
Apr 24, 2017
Merged

CHE-4865: Correctly detect installed java version #4870

2 commits merged into from
Apr 24, 2017

Conversation

tolusha
Copy link
Contributor

@tolusha tolusha commented Apr 21, 2017

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

@tolusha tolusha added kind/bug Outline of a bug - must adhere to the bug report template. team/enterprise labels Apr 21, 2017
@tolusha tolusha self-assigned this Apr 21, 2017
@tolusha tolusha requested review from benoitf, garagatyi and a user April 21, 2017 07:59
@ghost
Copy link

ghost commented Apr 21, 2017

Tested with codenvy/jdk7, codenvy/codenvy and eclipse/ubuntu_jdk8 images

@@ -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)

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?.

Copy link

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.

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?

Copy link

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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok then

@codenvy-ci
Copy link

@ghost ghost merged commit ad3dbd8 into master Apr 24, 2017
@ghost ghost deleted the CHE-4865 branch April 24, 2017 08:45
@bmicklea bmicklea added this to the 5.9.0 milestone Apr 26, 2017
JPinkney pushed a commit to JPinkney/che that referenced this pull request Aug 17, 2017
* CHE-4865: Correctly detect installed java version

* Fix up
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Outline of a bug - must adhere to the bug report template.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants