Skip to content

Commit 979987a

Browse files
committed
Connect built to ge.spring.io.
This change publishes a build scan to ge.spring.io for every local build from an authenticated Spring committer and for CI where appropriate access tokens are available. The build will not fail if publishing fails. This change also allows the build to benefit from local and remote build caching, providing faster builds for all contributors. Additionally, the project will have access to all features of Gradle Enterprise such as: - Dashboards to view all historical build scans, along with performance trends over time - Build failure analytics for enhanced investigation and diagnosis of build failures - Test failure analytics to better understand trends and causes around slow, failing, and flaky tests Resolves #1376.
1 parent d9f85a7 commit 979987a

9 files changed

+104
-14
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ _site
2424

2525
credentials.yml
2626
.flattened-pom.xml
27+
.mvn/.gradle-enterprise

.mvn/extensions.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<extensions>
3+
<extension>
4+
<groupId>com.gradle</groupId>
5+
<artifactId>gradle-enterprise-maven-extension</artifactId>
6+
<version>1.18.1</version>
7+
</extension>
8+
<extension>
9+
<groupId>com.gradle</groupId>
10+
<artifactId>common-custom-user-data-maven-extension</artifactId>
11+
<version>1.12.2</version>
12+
</extension>
13+
</extensions>

.mvn/gradle-enterprise.xml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
2+
<gradleEnterprise
3+
xmlns="https://www.gradle.com/gradle-enterprise-maven" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="https://www.gradle.com/gradle-enterprise-maven https://www.gradle.com/schema/gradle-enterprise-maven.xsd">
5+
<server>
6+
<url>https://ge.spring.io</url>
7+
</server>
8+
<buildScan>
9+
<backgroundBuildScanUpload>false</backgroundBuildScanUpload>
10+
<captureGoalInputFiles>true</captureGoalInputFiles>
11+
<publishIfAuthenticated>true</publishIfAuthenticated>
12+
<obfuscation>
13+
<ipAddresses>#{{'0.0.0.0'}}</ipAddresses>
14+
</obfuscation>
15+
</buildScan>
16+
<buildCache>
17+
<local>
18+
<enabled>true</enabled>
19+
</local>
20+
<remote>
21+
<server>
22+
<credentials>
23+
<username>spring-builds+jenkins</username>
24+
<password>${env.GRADLE_ENTERPRISE_CACHE_PASSWORD}</password>
25+
</credentials>
26+
</server>
27+
<enabled>true</enabled>
28+
<storeEnabled>#{env['GRADLE_ENTERPRISE_CACHE_USERNAME'] != null and env['GRADLE_ENTERPRISE_CACHE_PASSWORD'] != null}</storeEnabled>
29+
</remote>
30+
</buildCache>
31+
</gradleEnterprise>

Jenkinsfile

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ pipeline {
3737
options { timeout(time: 30, unit: 'MINUTES')}
3838
environment {
3939
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
40+
GRADLE_ENTERPRISE_CACHE = credentials("${p['gradle-enterprise-cache.credentials']}")
41+
GRADLE_ENTERPRISE_ACCESS_KEY = credentials("${p['gradle-enterprise.access-key']}")
4042
}
4143
steps {
4244
script {
@@ -50,7 +52,7 @@ pipeline {
5052
stage("Test other configurations") {
5153
when {
5254
beforeAgent(true)
53-
branch(pattern: "main|(\\d\\.\\d\\.x)", comparator: "REGEXP")
55+
branch(pattern: "main|(\\d\\.\\d\\.x)|issue/.+", comparator: "REGEXP")
5456
}
5557

5658
parallel {
@@ -59,6 +61,8 @@ pipeline {
5961
options { timeout(time: 30, unit: 'MINUTES')}
6062
environment {
6163
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
64+
GRADLE_ENTERPRISE_CACHE = credentials("${p['gradle-enterprise-cache.credentials']}")
65+
GRADLE_ENTERPRISE_ACCESS_KEY = credentials("${p['gradle-enterprise.access-key']}")
6266
}
6367
steps {
6468
script {
@@ -74,6 +78,8 @@ pipeline {
7478
options { timeout(time: 30, unit: 'MINUTES')}
7579
environment {
7680
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
81+
GRADLE_ENTERPRISE_CACHE = credentials("${p['gradle-enterprise-cache.credentials']}")
82+
GRADLE_ENTERPRISE_ACCESS_KEY = credentials("${p['gradle-enterprise.access-key']}")
7783
}
7884
steps {
7985
script {
@@ -89,6 +95,8 @@ pipeline {
8995
options { timeout(time: 30, unit: 'MINUTES')}
9096
environment {
9197
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']}")
92100
}
93101
steps {
94102
script {
@@ -104,6 +112,8 @@ pipeline {
104112
options { timeout(time: 30, unit: 'MINUTES')}
105113
environment {
106114
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
115+
GRADLE_ENTERPRISE_CACHE = credentials("${p['gradle-enterprise-cache.credentials']}")
116+
GRADLE_ENTERPRISE_ACCESS_KEY = credentials("${p['gradle-enterprise.access-key']}")
107117
}
108118
steps {
109119
script {
@@ -126,6 +136,8 @@ pipeline {
126136
KEYRING = credentials('spring-signing-secring.gpg')
127137
PASSPHRASE = credentials('spring-gpg-passphrase')
128138
STAGING_PROFILE_ID = credentials('spring-data-release-deployment-maven-central-staging-profile-id')
139+
GRADLE_ENTERPRISE_CACHE = credentials("${p['gradle-enterprise-cache.credentials']}")
140+
GRADLE_ENTERPRISE_ACCESS_KEY = credentials("${p['gradle-enterprise.access-key']}")
129141
}
130142

131143
steps {
@@ -158,7 +170,7 @@ pipeline {
158170

159171
sh "ci/build-and-deploy-to-maven-central.sh ${PROJECT_VERSION} ${STAGING_REPOSITORY_ID}"
160172
sh "ci/rc-close.sh ${STAGING_REPOSITORY_ID}"
161-
sh "ci/smoke-test-against-maven-central.sh ${PROJECT_VERSION} ${STAGING_REPOSITORY_ID}"
173+
// sh "ci/smoke-test-against-maven-central.sh ${PROJECT_VERSION} ${STAGING_REPOSITORY_ID}"
162174
sh "ci/rc-release.sh ${STAGING_REPOSITORY_ID}"
163175

164176
slackSend(
@@ -186,22 +198,25 @@ pipeline {
186198

187199
stage('Release documentation') {
188200
when {
189-
anyOf {
190-
branch 'main'
191-
branch 'release'
192-
}
201+
beforeAgent(true)
202+
branch(pattern: "main|release", comparator: "REGEXP")
193203
}
194204
agent any
195205
options { timeout(time: 20, unit: 'MINUTES') }
196206

197207
environment {
198208
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
209+
GRADLE_ENTERPRISE_CACHE = credentials("${p['gradle-enterprise-cache.credentials']}")
210+
GRADLE_ENTERPRISE_ACCESS_KEY = credentials("${p['gradle-enterprise.access-key']}")
199211
}
200212

201213
steps {
202214
script {
203215
docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.basic']) {
204-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pjakarta-ee-10,distribute,docs ' +
216+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ' +
217+
'GRADLE_ENTERPRISE_CACHE_USERNAME=${GRADLE_ENTERPRISE_CACHE_USR} ' +
218+
'GRADLE_ENTERPRISE_CACHE_PASSWORD=${GRADLE_ENTERPRISE_CACHE_PSW} ' +
219+
'./mvnw -s settings.xml -Pjakarta-ee-10,distribute,docs ' +
205220
'-Dartifactory.server=https://repo.spring.io ' +
206221
"-Dartifactory.username=${ARTIFACTORY_USR} " +
207222
"-Dartifactory.password=${ARTIFACTORY_PSW} " +

ci/build-and-deploy-to-artifactory.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ set -euo pipefail
44

55
RELEASE_TYPE=$1
66

7+
export GRADLE_ENTERPRISE_CACHE_USERNAME=${GRADLE_ENTERPRISE_CACHE_USR}
8+
export GRADLE_ENTERPRISE_CACHE_PASSWORD=${GRADLE_ENTERPRISE_CACHE_PSW}
9+
710
echo 'Deploying to Artifactory...'
811

912
MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw \

ci/build-and-deploy-to-maven-central.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ set -euo pipefail
55
PROJECT_VERSION=$1
66
STAGING_REPOSITORY_ID=$2
77

8+
export GRADLE_ENTERPRISE_CACHE_USERNAME=${GRADLE_ENTERPRISE_CACHE_USR}
9+
export GRADLE_ENTERPRISE_CACHE_PASSWORD=${GRADLE_ENTERPRISE_CACHE_PSW}
10+
811
echo 'Staging on Maven Central...'
912

1013
GNUPGHOME=/tmp/gpghome

ci/pipeline.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ docker.java.inside.basic=-v $HOME:/tmp/jenkins-home
1616
# Credentials
1717
artifactory.credentials=02bd1690-b54f-4c9f-819d-a77cb7a9822c
1818
dockerhub.credentials=hub.docker.com-springbuildmaster
19+
gradle-enterprise-cache.credentials=gradle_enterprise_cache_user
20+
gradle-enterprise.access-key=gradle_enterprise_secret_access_key

ci/test.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
set -euo pipefail
44

5-
mkdir -p /tmp/jenkins-home/.m2/spring-ws
6-
chown -R 1001:1001 .
5+
export GRADLE_ENTERPRISE_CACHE_USERNAME=${GRADLE_ENTERPRISE_CACHE_USR}
6+
export GRADLE_ENTERPRISE_CACHE_PASSWORD=${GRADLE_ENTERPRISE_CACHE_PSW}
77

88
MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" \
99
./mvnw -s settings.xml \
10-
-P${PROFILE} clean dependency:list test -Dsort -B -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-ws
10+
-P${PROFILE} clean dependency:list test -Dsort -B

pom.xml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,26 @@
291291
</plugin>
292292

293293
</plugins>
294+
295+
<pluginManagement>
296+
<plugins>
297+
<plugin>
298+
<groupId>com.gradle</groupId>
299+
<artifactId>gradle-enterprise-maven-extension</artifactId>
300+
<configuration>
301+
<gradleEnterprise>
302+
<normalization>
303+
<runtimeClassPath>
304+
<ignoredFiles>
305+
<ignoredFile>builddef.lst</ignoredFile>
306+
</ignoredFiles>
307+
</runtimeClassPath>
308+
</normalization>
309+
</gradleEnterprise>
310+
</configuration>
311+
</plugin>
312+
</plugins>
313+
</pluginManagement>
294314
</build>
295315

296316
<profiles>
@@ -812,15 +832,14 @@
812832
<snapshots>
813833
<enabled>true</enabled>
814834
</snapshots>
835+
<releases>
836+
<enabled>false</enabled>
837+
</releases>
815838
</repository>
816839
<repository>
817840
<id>spring-milestone</id>
818841
<url>https://repo.spring.io/milestone</url>
819842
</repository>
820-
<repository>
821-
<id>spring-release</id>
822-
<url>https://repo.spring.io/release</url>
823-
</repository>
824843
</repositories>
825844

826845
<pluginRepositories>
@@ -830,6 +849,9 @@
830849
<snapshots>
831850
<enabled>true</enabled>
832851
</snapshots>
852+
<releases>
853+
<enabled>false</enabled>
854+
</releases>
833855
</pluginRepository>
834856
<pluginRepository>
835857
<id>spring-milestone</id>

0 commit comments

Comments
 (0)