-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from gocd-contrib/go-agent-on-java10-11
Install JDK10 and JDK11
- Loading branch information
Showing
4 changed files
with
31 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,11 +62,19 @@ EOF | |
try gauge --version | ||
} | ||
|
||
function install_openjdk() { | ||
function install_jdk8() { | ||
try yum install --assumeyes java-1.8.0-openjdk java-1.8.0-openjdk-devel | ||
try java -version | ||
} | ||
|
||
function install_jdk10() { | ||
try su - go -c "jabba install [email protected]" | ||
} | ||
|
||
function install_jdk11() { | ||
try su - go -c "jabba install [email protected]" | ||
} | ||
|
||
function install_native_build_packages() { | ||
try yum install --assumeyes centos-release-scl # for gcc-6 | ||
|
||
|
@@ -122,7 +130,7 @@ else | |
|
||
try yum install --assumeyes git subversion | ||
|
||
try mkdir -p /usr/local/bin | ||
try mkdir -p /usr/local/bin | ||
try curl --silent --fail --location https://s3.amazonaws.com/mirrors-archive/local/perforce/r${P4_VERSION}/bin.linux26x86_64/p4 --output /usr/local/bin/p4 | ||
try curl --silent --fail --location https://s3.amazonaws.com/mirrors-archive/local/perforce/r${P4D_VERSION}/bin.linux26x86_64/p4d --output /usr/local/bin/p4d | ||
try chmod 755 /usr/local/bin/p4 /usr/local/bin/p4d | ||
|
@@ -286,7 +294,9 @@ function add_golang_gocd_bootstrapper() { | |
} | ||
|
||
function setup_entrypoint() { | ||
try cp /usr/local/src/provision/with-java /usr/local/bin/with-java | ||
try cp /usr/local/src/provision/bootstrap.sh /bootstrap.sh | ||
try chmod 755 /usr/local/bin/with-java | ||
try chmod 755 /bootstrap.sh | ||
} | ||
|
||
|
@@ -299,10 +309,15 @@ function build_gocd() { | |
|
||
setup_epel | ||
install_basic_utils | ||
# setup gocd user to use internal mirrors for builds | ||
add_gocd_user | ||
install_node | ||
install_yarn | ||
install_gauge | ||
install_openjdk | ||
install_jabba | ||
install_jdk8 | ||
install_jdk10 | ||
install_jdk11 | ||
install_native_build_packages | ||
install_ruby | ||
install_python | ||
|
@@ -320,9 +335,6 @@ if [ "$CENTOS_MAJOR_VERSION" == "7" ]; then | |
install_xvfb | ||
fi | ||
|
||
# setup gocd user to use internal mirrors for builds | ||
add_gocd_user | ||
install_jabba | ||
setup_git_config | ||
build_gocd | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ "${JAVA_VERSION}" = "10" ]; then | ||
source "${HOME}/.jabba/jabba.sh" | ||
jabba use "[email protected]" | ||
elif [ "${JAVA_VERSION}" = "11" ]; then | ||
source "${HOME}/.jabba/jabba.sh" | ||
jabba use "[email protected]" | ||
fi | ||
|
||
exec "$@" |