Skip to content

Commit

Permalink
fix(jenkins): Align Java's user.home with HOME
Browse files Browse the repository at this point in the history
In a Docker-in-Docker scenario where Jenkins itself is running in Docker
on the host, and ORT also inside Docker as part of Jenkins build stages,
the `user.home` Java system property diverges from the custom `HOME`
directory set in the stage environment, resulting in problems like a
netrc file being looked up in the wrong place.

Fix this by explicitly setting `user.home` to the same value as `HOME`.

Signed-off-by: Mikko Murto <mikko.murto@doubleopen.org>
  • Loading branch information
mmurto authored and sschuberth committed Nov 23, 2023
1 parent e4b018b commit acda964
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions integrations/jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ pipeline {

environment {
HOME = "${env.WORKSPACE}@tmp"
JAVA_OPTS = "-Duser.home=${env.HOME}"
}

steps {
Expand All @@ -273,6 +274,7 @@ pipeline {

environment {
HOME = "${env.WORKSPACE}@tmp"
JAVA_OPTS = "-Duser.home=${env.HOME}"
PROJECT_DIR = "${env.HOME}/project"
}

Expand Down Expand Up @@ -319,6 +321,7 @@ pipeline {

environment {
HOME = "${env.WORKSPACE}@tmp"
JAVA_OPTS = "-Duser.home=${env.HOME}"
ORT_DATA_DIR = "${env.HOME}/.ort"
}

Expand Down Expand Up @@ -379,6 +382,7 @@ pipeline {

environment {
HOME = "${env.WORKSPACE}@tmp"
JAVA_OPTS = "-Duser.home=${env.HOME}"
PROJECT_DIR = "${env.HOME}/project"
}

Expand Down Expand Up @@ -460,6 +464,7 @@ pipeline {

environment {
HOME = "${env.WORKSPACE}@tmp"
JAVA_OPTS = "-Duser.home=${env.HOME}"
}

steps {
Expand Down Expand Up @@ -573,6 +578,7 @@ pipeline {

environment {
HOME = "${env.WORKSPACE}@tmp"
JAVA_OPTS = "-Duser.home=${env.HOME}"
}

steps {
Expand Down Expand Up @@ -632,6 +638,7 @@ pipeline {

environment {
HOME = "${env.WORKSPACE}@tmp"
JAVA_OPTS = "-Duser.home=${env.HOME}"
}

steps {
Expand Down Expand Up @@ -684,6 +691,7 @@ pipeline {

environment {
HOME = "${env.WORKSPACE}@tmp"
JAVA_OPTS = "-Duser.home=${env.HOME}"
}

steps {
Expand Down

0 comments on commit acda964

Please sign in to comment.