From f39c7e0b44565afea910354605f8e9ceacb3c8e0 Mon Sep 17 00:00:00 2001 From: Jens Schauder Date: Mon, 16 Oct 2023 11:15:42 +0200 Subject: [PATCH] Setup Gradle Enterprise credentials. See #1643 --- Jenkinsfile | 12 +++++++++++- ci/pipeline.properties | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1101910a4a4..bd01bf76847 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -33,6 +33,8 @@ pipeline { environment { ARTIFACTORY = credentials("${p['artifactory.credentials']}") + GRADLE_ENTERPRISE_CACHE = credentials("${p['gradle-enterprise-cache.credentials']}") + GRADLE_ENTERPRISE_ACCESS_KEY = credentials("${p['gradle-enterprise.access-key']}") TESTCONTAINERS_IMAGE_SUBSTITUTOR = 'org.springframework.data.ProxyImageNameSubstitutor' } @@ -62,6 +64,8 @@ pipeline { options { timeout(time: 30, unit: 'MINUTES') } environment { ARTIFACTORY = credentials("${p['artifactory.credentials']}") + GRADLE_ENTERPRISE_CACHE = credentials("${p['gradle-enterprise-cache.credentials']}") + GRADLE_ENTERPRISE_ACCESS_KEY = credentials("${p['gradle-enterprise.access-key']}") TESTCONTAINERS_IMAGE_SUBSTITUTOR = 'org.springframework.data.ProxyImageNameSubstitutor' } steps { @@ -91,12 +95,18 @@ pipeline { environment { ARTIFACTORY = credentials("${p['artifactory.credentials']}") + GRADLE_ENTERPRISE_CACHE = credentials("${p['gradle-enterprise-cache.credentials']}") + GRADLE_ENTERPRISE_ACCESS_KEY = credentials("${p['gradle-enterprise.access-key']}") } steps { script { docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.basic']) { - sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pci,artifactory -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-relational-non-root ' + + sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ' + + 'GRADLE_ENTERPRISE_CACHE_USERNAME=${GRADLE_ENTERPRISE_CACHE_USR} ' + + 'GRADLE_ENTERPRISE_CACHE_PASSWORD=${GRADLE_ENTERPRISE_CACHE_PSW} ' + + 'GRADLE_ENTERPRISE_ACCESS_KEY=${GRADLE_ENTERPRISE_ACCESS_KEY} ' + + './mvnw -s settings.xml -Pci,artifactory -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-relational-non-root ' + '-Dartifactory.server=https://repo.spring.io ' + "-Dartifactory.username=${ARTIFACTORY_USR} " + "-Dartifactory.password=${ARTIFACTORY_PSW} " + diff --git a/ci/pipeline.properties b/ci/pipeline.properties index afea58c5afe..427c3ad9e45 100644 --- a/ci/pipeline.properties +++ b/ci/pipeline.properties @@ -26,3 +26,5 @@ docker.java.inside.docker=-u root -v /var/run/docker.sock:/var/run/docker.sock - docker.registry= docker.credentials=hub.docker.com-springbuildmaster artifactory.credentials=02bd1690-b54f-4c9f-819d-a77cb7a9822c +gradle-enterprise-cache.credentials=gradle_enterprise_cache_user +gradle-enterprise.access-key=gradle_enterprise_secret_access_key