HBASE-22955 Properly set jdk7 as JAVA_HOME for branches-1 precommit and nightly. (#621)

master/branches-2 specific changes: work around yetus overwriting JAVA_HOME
in the container with the host JAVA_HOME.

Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
(cherry picked from commit 41990ba20a)
(cherry picked from commit bcad0d9f98)
This commit is contained in:
Sean Busbey 2019-09-12 20:35:29 -05:00
parent c887112e71
commit 1cbed077f1
3 changed files with 25 additions and 0 deletions

View File

@ -110,6 +110,10 @@ pipeline {
if [[ "true" = "${DEBUG}" ]]; then if [[ "true" = "${DEBUG}" ]]; then
YETUS_ARGS+=("--debug") YETUS_ARGS+=("--debug")
fi 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}") YETUS_ARGS+=("--patch-dir=${WORKSPACE}/${PATCHDIR}")
# where the source is located # where the source is located
YETUS_ARGS+=("--basedir=${WORKSPACE}/${SOURCEDIR}") YETUS_ARGS+=("--basedir=${WORKSPACE}/${SOURCEDIR}")

View File

@ -45,6 +45,23 @@ if ! declare -f "yetus_info" >/dev/null; then
fi 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 ## @description Globals specific to this personality
## @audience private ## @audience private
## @stability evolving ## @stability evolving

View File

@ -40,6 +40,10 @@ if [[ -n "${MULTIJDK}" ]]; then
YETUS_ARGS=("--multijdkdirs=${MULTIJDK}" "${YETUS_ARGS[@]}") YETUS_ARGS=("--multijdkdirs=${MULTIJDK}" "${YETUS_ARGS[@]}")
fi 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 if [[ -n "${SET_JAVA_HOME}" ]]; then
YETUS_ARGS=("--java-home=${SET_JAVA_HOME}" "${YETUS_ARGS[@]}") YETUS_ARGS=("--java-home=${SET_JAVA_HOME}" "${YETUS_ARGS[@]}")
fi fi