Skip to content

Commit a3bd7a6

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 #2158
1 parent c6af12e commit a3bd7a6

File tree

5 files changed

+68
-5
lines changed

5 files changed

+68
-5
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ target
99
.project
1010
.classpath
1111
.idea
12-
credentials.yml
12+
credentials.yml
13+
.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.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

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>${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

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,17 @@ pipeline {
2525
options { timeout(time: 30, unit: 'MINUTES') }
2626
environment {
2727
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
28+
DEVELOCITY_CACHE = credentials("${p['develocity.cache.credentials']}")
29+
DEVELOCITY_ACCESS_KEY = credentials("${p['develocity.access-key']}")
2830
}
2931
steps {
3032
script {
3133
docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.basic']) {
32-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml clean dependency:list verify -Dsort -B'
34+
sh 'MAVEN_OPTS="-Duser.name=spring-builds+jenkins -Duser.home=/tmp/jenkins-home" ' +
35+
'DEVELOCITY_CACHE_USERNAME=${DEVELOCITY_CACHE_USR} ' +
36+
'DEVELOCITY_CACHE_PASSWORD=${DEVELOCITY_CACHE_PSW} ' +
37+
'GRADLE_ENTERPRISE_ACCESS_KEY=${DEVELOCITY_ACCESS_KEY} ' +
38+
'./mvnw -s settings.xml clean dependency:list verify -Dsort -B'
3339
}
3440
}
3541
}
@@ -51,11 +57,17 @@ pipeline {
5157
options { timeout(time: 30, unit: 'MINUTES') }
5258
environment {
5359
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
60+
DEVELOCITY_CACHE = credentials("${p['develocity.cache.credentials']}")
61+
DEVELOCITY_ACCESS_KEY = credentials("${p['develocity.access-key']}")
5462
}
5563
steps {
5664
script {
5765
docker.image(p['docker.java.next.image']).inside(p['docker.java.inside.basic']) {
58-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml clean dependency:list verify -Dsort -B'
66+
sh 'MAVEN_OPTS="-Duser.name=spring-builds+jenkins -Duser.home=/tmp/jenkins-home" ' +
67+
'DEVELOCITY_CACHE_USERNAME=${DEVELOCITY_CACHE_USR} ' +
68+
'DEVELOCITY_CACHE_PASSWORD=${DEVELOCITY_CACHE_PSW} ' +
69+
'GRADLE_ENTERPRISE_ACCESS_KEY=${DEVELOCITY_ACCESS_KEY} ' +
70+
'./mvnw -s settings.xml clean dependency:list verify -Dsort -B'
5971
}
6072
}
6173
}
@@ -71,12 +83,18 @@ pipeline {
7183

7284
environment {
7385
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
86+
DEVELOCITY_CACHE = credentials("${p['develocity.cache.credentials']}")
87+
DEVELOCITY_ACCESS_KEY = credentials("${p['develocity.access-key']}")
7488
}
7589

7690
steps {
7791
script {
7892
docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.basic']) {
79-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pci,artifactory ' +
93+
sh 'MAVEN_OPTS="-Duser.name=spring-builds+jenkins -Duser.home=/tmp/jenkins-home" ' +
94+
'DEVELOCITY_CACHE_USERNAME=${DEVELOCITY_CACHE_USR} ' +
95+
'DEVELOCITY_CACHE_PASSWORD=${DEVELOCITY_CACHE_PSW} ' +
96+
'GRADLE_ENTERPRISE_ACCESS_KEY=${DEVELOCITY_ACCESS_KEY} ' +
97+
'./mvnw -s settings.xml -Pci,artifactory ' +
8098
'-Dartifactory.server=https://repo.spring.io ' +
8199
"-Dartifactory.username=${ARTIFACTORY_USR} " +
82100
"-Dartifactory.password=${ARTIFACTORY_PSW} " +

README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= Spring Data Build Infrastructure image:https://jenkins.spring.io/buildStatus/icon?job=spring-data-build%2Fmain&subject=Build[link=https://jenkins.spring.io/view/SpringData/job/spring-data-build/]
1+
= Spring Data Build Infrastructure image:https://jenkins.spring.io/buildStatus/icon?job=spring-data-build%2Fmain&subject=Build[link=https://jenkins.spring.io/view/SpringData/job/spring-data-build/] 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 Build"]
22

33
This repository contains common infrastructure to be used by Spring Data modules that build with Maven. It consists of a _resources_ project that bundles up resources that are needed during the build CSS for reference documentation generation and JavaDoc. The second project is _parent_ that can be used as parent project to pre-configure core dependencies, properties, reference documentation generation and most important of all the appropriate distribution assembly.
44

0 commit comments

Comments
 (0)