From 87cb4ad026e1005ec371806c9a5734a3524e8cb9 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Tue, 8 Oct 2024 11:22:39 +0200 Subject: [PATCH] Consistently run all CI steps with the same user. See #1883 --- Jenkinsfile | 4 +++- ci/clean.sh | 2 +- ci/test.sh | 3 +-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2ccabaaea7e..b96109991fe 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -101,15 +101,17 @@ 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-relational " + "-Dartifactory.build-number=spring-data-relational-${BRANCH_NAME}-build-${BUILD_NUMBER} " + + "-Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-jdbc " + "-Dmaven.test.skip=true clean deploy -U -B" } } diff --git a/ci/clean.sh b/ci/clean.sh index 5cef3ab005c..178a62bc782 100755 --- a/ci/clean.sh +++ b/ci/clean.sh @@ -5,4 +5,4 @@ set -euo pipefail export JENKINS_USER=${JENKINS_USER_NAME} MAVEN_OPTS="-Duser.name=${JENKINS_USER} -Duser.home=/tmp/jenkins-home" \ - ./mvnw -s settings.xml -Dscan=false clean -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-jdbc + ./mvnw -s settings.xml -Dscan=false clean -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-jdbc -Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-root diff --git a/ci/test.sh b/ci/test.sh index fdaaecf9c53..6cdf8602d6c 100755 --- a/ci/test.sh +++ b/ci/test.sh @@ -9,10 +9,9 @@ cp spring-data-relational/src/test/java/org/springframework/data/ProxyImageNameS cp spring-data-relational/src/test/java/org/springframework/data/ProxyImageNameSubstitutor.java spring-data-r2dbc/src/test/java/org/springframework/data mkdir -p /tmp/jenkins-home -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 verify -Dsort -U -B -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-jdbc + -P${PROFILE} clean dependency:list verify -Dsort -U -B -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-jdbc -Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-root