Skip to content

Commit f39c7e0

Browse files
committed
Setup Gradle Enterprise credentials.
See #1643
1 parent 7324cac commit f39c7e0

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Jenkinsfile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ pipeline {
3333

3434
environment {
3535
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
36+
GRADLE_ENTERPRISE_CACHE = credentials("${p['gradle-enterprise-cache.credentials']}")
37+
GRADLE_ENTERPRISE_ACCESS_KEY = credentials("${p['gradle-enterprise.access-key']}")
3638
TESTCONTAINERS_IMAGE_SUBSTITUTOR = 'org.springframework.data.ProxyImageNameSubstitutor'
3739
}
3840

@@ -62,6 +64,8 @@ pipeline {
6264
options { timeout(time: 30, unit: 'MINUTES') }
6365
environment {
6466
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
67+
GRADLE_ENTERPRISE_CACHE = credentials("${p['gradle-enterprise-cache.credentials']}")
68+
GRADLE_ENTERPRISE_ACCESS_KEY = credentials("${p['gradle-enterprise.access-key']}")
6569
TESTCONTAINERS_IMAGE_SUBSTITUTOR = 'org.springframework.data.ProxyImageNameSubstitutor'
6670
}
6771
steps {
@@ -91,12 +95,18 @@ pipeline {
9195

9296
environment {
9397
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
98+
GRADLE_ENTERPRISE_CACHE = credentials("${p['gradle-enterprise-cache.credentials']}")
99+
GRADLE_ENTERPRISE_ACCESS_KEY = credentials("${p['gradle-enterprise.access-key']}")
94100
}
95101

96102
steps {
97103
script {
98104
docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.basic']) {
99-
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 ' +
105+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ' +
106+
'GRADLE_ENTERPRISE_CACHE_USERNAME=${GRADLE_ENTERPRISE_CACHE_USR} ' +
107+
'GRADLE_ENTERPRISE_CACHE_PASSWORD=${GRADLE_ENTERPRISE_CACHE_PSW} ' +
108+
'GRADLE_ENTERPRISE_ACCESS_KEY=${GRADLE_ENTERPRISE_ACCESS_KEY} ' +
109+
'./mvnw -s settings.xml -Pci,artifactory -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-relational-non-root ' +
100110
'-Dartifactory.server=https://repo.spring.io ' +
101111
"-Dartifactory.username=${ARTIFACTORY_USR} " +
102112
"-Dartifactory.password=${ARTIFACTORY_PSW} " +

ci/pipeline.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ docker.java.inside.docker=-u root -v /var/run/docker.sock:/var/run/docker.sock -
2626
docker.registry=
2727
docker.credentials=hub.docker.com-springbuildmaster
2828
artifactory.credentials=02bd1690-b54f-4c9f-819d-a77cb7a9822c
29+
gradle-enterprise-cache.credentials=gradle_enterprise_cache_user
30+
gradle-enterprise.access-key=gradle_enterprise_secret_access_key

0 commit comments

Comments
 (0)