Skip to content

Commit 2b207b1

Browse files
erichaagdevgregturn
authored andcommitted
Connect build 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 See spring-projects#2319
1 parent d3f30c1 commit 2b207b1

File tree

5 files changed

+67
-4
lines changed

5 files changed

+67
-4
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ node_modules
1616
package-lock.json
1717
package.json
1818
node
19+
.mvn/.gradle-enterprise

.mvn/extensions.xml

+13
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.19.2</version>
7+
</extension>
8+
<extension>
9+
<groupId>com.gradle</groupId>
10+
<artifactId>common-custom-user-data-maven-extension</artifactId>
11+
<version>1.12.4</version>
12+
</extension>
13+
</extensions>

.mvn/gradle-enterprise.xml

+31
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>#{isFalse(env['CI'])}</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>${env.DEVELOCITY_CACHE_USERNAME}</username>
24+
<password>${env.DEVELOCITY_CACHE_PASSWORD}</password>
25+
</credentials>
26+
</server>
27+
<enabled>true</enabled>
28+
<storeEnabled>#{env['DEVELOCITY_CACHE_USERNAME'] != null and env['DEVELOCITY_CACHE_PASSWORD'] != null}</storeEnabled>
29+
</remote>
30+
</buildCache>
31+
</gradleEnterprise>

Jenkinsfile

+21-3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ pipeline {
3333
options { timeout(time: 30, unit: 'MINUTES') }
3434
environment {
3535
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
36+
DEVELOCITY_CACHE = credentials("${p['develocity.cache.credentials']}")
37+
DEVELOCITY_ACCESS_KEY = credentials("${p['develocity.access-key']}")
3638
}
3739
steps {
3840
script {
@@ -42,7 +44,11 @@ pipeline {
4244
sh 'sleep 10'
4345
sh 'mongo --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"'
4446
sh 'sleep 15'
45-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml clean dependency:list test -Dsort -U -B -Pit'
47+
sh 'MAVEN_OPTS="-Duser.name=spring-builds+jenkins -Duser.home=/tmp/jenkins-home" ' +
48+
'DEVELOCITY_CACHE_USERNAME=${DEVELOCITY_CACHE_USR} ' +
49+
'DEVELOCITY_CACHE_PASSWORD=${DEVELOCITY_CACHE_PSW} ' +
50+
'GRADLE_ENTERPRISE_ACCESS_KEY=${DEVELOCITY_ACCESS_KEY} ' +
51+
'./mvnw -s settings.xml clean dependency:list test -Dsort -U -B -Pit'
4652
}
4753
}
4854
}
@@ -64,6 +70,8 @@ pipeline {
6470
options { timeout(time: 30, unit: 'MINUTES') }
6571
environment {
6672
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
73+
DEVELOCITY_CACHE = credentials("${p['develocity.cache.credentials']}")
74+
DEVELOCITY_ACCESS_KEY = credentials("${p['develocity.access-key']}")
6775
}
6876
steps {
6977
script {
@@ -73,7 +81,11 @@ pipeline {
7381
sh 'sleep 10'
7482
sh 'mongosh --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"'
7583
sh 'sleep 15'
76-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml clean dependency:list test -Dsort -U -B -Pit'
84+
sh 'MAVEN_OPTS="-Duser.name=spring-builds+jenkins -Duser.home=/tmp/jenkins-home" ' +
85+
'DEVELOCITY_CACHE_USERNAME=${DEVELOCITY_CACHE_USR} ' +
86+
'DEVELOCITY_CACHE_PASSWORD=${DEVELOCITY_CACHE_PSW} ' +
87+
'GRADLE_ENTERPRISE_ACCESS_KEY=${DEVELOCITY_ACCESS_KEY} ' +
88+
'./mvnw -s settings.xml clean dependency:list test -Dsort -U -B -Pit'
7789
}
7890
}
7991
}
@@ -96,12 +108,18 @@ pipeline {
96108

97109
environment {
98110
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
111+
DEVELOCITY_CACHE = credentials("${p['develocity.cache.credentials']}")
112+
DEVELOCITY_ACCESS_KEY = credentials("${p['develocity.access-key']}")
99113
}
100114

101115
steps {
102116
script {
103117
docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.basic']) {
104-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pci,artifactory ' +
118+
sh 'MAVEN_OPTS="-Duser.name=spring-builds+jenkins -Duser.home=/tmp/jenkins-home" ' +
119+
'DEVELOCITY_CACHE_USERNAME=${DEVELOCITY_CACHE_USR} ' +
120+
'DEVELOCITY_CACHE_PASSWORD=${DEVELOCITY_CACHE_PSW} ' +
121+
'GRADLE_ENTERPRISE_ACCESS_KEY=${DEVELOCITY_ACCESS_KEY} ' +
122+
'./mvnw -s settings.xml -Pci,artifactory ' +
105123
'-Dartifactory.server=https://repo.spring.io ' +
106124
"-Dartifactory.username=${ARTIFACTORY_USR} " +
107125
"-Dartifactory.password=${ARTIFACTORY_PSW} " +

README.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= Spring Data REST image:https://jenkins.spring.io/buildStatus/icon?job=spring-data-rest%2Fmain&subject=Build[link=https://jenkins.spring.io/view/SpringData/job/spring-data-rest/] https://gitter.im/spring-projects/spring-data[image:https://badges.gitter.im/spring-projects/spring-data.svg[Gitter]]
1+
= Spring Data REST image:https://jenkins.spring.io/buildStatus/icon?job=spring-data-rest%2Fmain&subject=Build[link=https://jenkins.spring.io/view/SpringData/job/spring-data-rest/] https://gitter.im/spring-projects/spring-data[image:https://badges.gitter.im/spring-projects/spring-data.svg[Gitter]] image:https://img.shields.io/badge/Revved%20up%20by-Gradle%20Enterprise-06A0CE?logo=Gradle&labelColor=02303A["Revved up by Gradle Enterprise", link="https://ge.spring.io/scans?search.rootProjectNames=Spring Data REST"]
22

33
The goal of the project is to provide a flexible and configurable mechanism for writing simple services that can be exposed over HTTP.
44

0 commit comments

Comments
 (0)