From 61e6d36c7f41cccb8297b4e9c53af8ea0a34066b Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Tue, 8 Oct 2024 11:19:00 +0200 Subject: [PATCH] Consistently run all CI steps with the same user. See #3610 --- Jenkinsfile | 7 ++++--- ci/test.sh | 7 ++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3cfe2ce914..915e46ddb7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -168,17 +168,18 @@ pipeline { steps { script { docker.withRegistry(p['docker.proxy.registry'], p['docker.proxy.credentials']) { - docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.basic']) { + docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.docker']) { sh 'MAVEN_OPTS="-Duser.name=' + "${p['jenkins.user.name']}" + ' -Duser.home=/tmp/jenkins-home" ' + "./mvnw -s settings.xml -Pci,artifactory " + + "-Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-root " + "-Dartifactory.server=${p['artifactory.url']} " + "-Dartifactory.username=${ARTIFACTORY_USR} " + "-Dartifactory.password=${ARTIFACTORY_PSW} " + "-Dartifactory.staging-repository=${p['artifactory.repository.snapshot']} " + "-Dartifactory.build-name=spring-data-jpa " + "-Dartifactory.build-number=spring-data-jpa-${BRANCH_NAME}-build-${BUILD_NUMBER} " + - '-Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-jpa-enterprise ' + - '-Dmaven.test.skip=true clean deploy -U -B ' + "-Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-jpa " + + "-Dmaven.test.skip=true clean deploy -U -B " } } } diff --git a/ci/test.sh b/ci/test.sh index b22fbc56a5..7be7e11139 100755 --- a/ci/test.sh +++ b/ci/test.sh @@ -4,15 +4,12 @@ set -euo pipefail mkdir -p /tmp/jenkins-home/.m2/spring-data-jpa mkdir -p /tmp/jenkins-home/.m2/.develocity -chown -R 1001:1001 . export JENKINS_USER=${JENKINS_USER_NAME} MAVEN_OPTS="-Duser.name=${JENKINS_USER} -Duser.home=/tmp/jenkins-home" \ ./mvnw -s settings.xml \ - -P${PROFILE} clean dependency:list test -Dsort -U -B -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-jpa + -P${PROFILE} clean dependency:list test -Dsort -U -B -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-jpa -Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-root MAVEN_OPTS="-Duser.name=${JENKINS_USER} -Duser.home=/tmp/jenkins-home" \ - ./mvnw -s settings.xml clean -Dscan=false -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-jpa - -chown -R 1001:1001 /tmp/jenkins-home/.m2/.develocity + ./mvnw -s settings.xml clean -Dscan=false -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-jpa -Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-root