diff --git a/dev-support/Jenkinsfile_GitHub b/dev-support/Jenkinsfile_GitHub index 693a1c8a17c..c9f5f1780a3 100644 --- a/dev-support/Jenkinsfile_GitHub +++ b/dev-support/Jenkinsfile_GitHub @@ -110,6 +110,10 @@ pipeline { if [[ "true" = "${DEBUG}" ]]; then YETUS_ARGS+=("--debug") fi + # If we're doing docker, make sure we don't accidentally pollute the image with a host java path + if [ -n "${JAVA_HOME}" ]; then + unset JAVA_HOME + fi YETUS_ARGS+=("--patch-dir=${WORKSPACE}/${PATCHDIR}") # where the source is located YETUS_ARGS+=("--basedir=${WORKSPACE}/${SOURCEDIR}") diff --git a/dev-support/hbase-personality.sh b/dev-support/hbase-personality.sh index b4b7880888f..84b90be83d4 100755 --- a/dev-support/hbase-personality.sh +++ b/dev-support/hbase-personality.sh @@ -45,6 +45,23 @@ if ! declare -f "yetus_info" >/dev/null; then fi +# work around yetus overwriting JAVA_HOME from our docker image +function docker_do_env_adds +{ + declare k + + for k in "${DOCKER_EXTRAENVS[@]}"; do + if [[ "JAVA_HOME" == "${k}" ]]; then + if [ -n "${JAVA_HOME}" ]; then + DOCKER_EXTRAARGS+=("--env=JAVA_HOME=${JAVA_HOME}") + fi + else + DOCKER_EXTRAARGS+=("--env=${k}=${!k}") + fi + done +} + + ## @description Globals specific to this personality ## @audience private ## @stability evolving diff --git a/dev-support/hbase_nightly_yetus.sh b/dev-support/hbase_nightly_yetus.sh index 3c9e270c39b..91590576e20 100755 --- a/dev-support/hbase_nightly_yetus.sh +++ b/dev-support/hbase_nightly_yetus.sh @@ -40,6 +40,10 @@ if [[ -n "${MULTIJDK}" ]]; then YETUS_ARGS=("--multijdkdirs=${MULTIJDK}" "${YETUS_ARGS[@]}") fi +# If we're doing docker, make sure we don't accidentally pollute the image with a host java path +if [ -n "${JAVA_HOME}" ]; then + unset JAVA_HOME +fi if [[ -n "${SET_JAVA_HOME}" ]]; then YETUS_ARGS=("--java-home=${SET_JAVA_HOME}" "${YETUS_ARGS[@]}") fi