Skip to content

Commit 8404616

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 #1853
1 parent 88b8939 commit 8404616

File tree

7 files changed

+72
-4
lines changed

7 files changed

+72
-4
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ node_modules
1313
node
1414
package.json
1515
package-lock.json
16+
17+
.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: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ pipeline {
3232
options { timeout(time: 30, unit: 'MINUTES') }
3333
environment {
3434
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
35+
DEVELOCITY_CACHE = credentials("${p['develocity.cache.credentials']}")
36+
DEVELOCITY_ACCESS_KEY = credentials("${p['develocity.access-key']}")
3537
}
3638
steps {
3739
script {
@@ -59,6 +61,8 @@ pipeline {
5961
options { timeout(time: 30, unit: 'MINUTES') }
6062
environment {
6163
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
64+
DEVELOCITY_CACHE = credentials("${p['develocity.cache.credentials']}")
65+
DEVELOCITY_ACCESS_KEY = credentials("${p['develocity.access-key']}")
6266
}
6367
steps {
6468
script {
@@ -87,12 +91,18 @@ pipeline {
8791

8892
environment {
8993
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
94+
DEVELOCITY_CACHE = credentials("${p['develocity.cache.credentials']}")
95+
DEVELOCITY_ACCESS_KEY = credentials("${p['develocity.access-key']}")
9096
}
9197

9298
steps {
9399
script {
94100
docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.basic']) {
95-
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-couchbase-non-root ' +
101+
sh 'MAVEN_OPTS="-Duser.name=spring-builds+jenkins -Duser.home=/tmp/jenkins-home" '+
102+
'DEVELOCITY_CACHE_USERNAME=${DEVELOCITY_CACHE_USR} ' +
103+
'DEVELOCITY_CACHE_PASSWORD=${DEVELOCITY_CACHE_PSW} ' +
104+
'GRADLE_ENTERPRISE_ACCESS_KEY=${DEVELOCITY_ACCESS_KEY} ' +
105+
'./mvnw -s settings.xml -Pci,artifactory -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-couchbase-non-root ' +
96106
'-Dartifactory.server=https://repo.spring.io ' +
97107
"-Dartifactory.username=${ARTIFACTORY_USR} " +
98108
"-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 Couchbase image:https://jenkins.spring.io/buildStatus/icon?job=spring-data-couchbase%2Fmain&subject=Build[link=https://jenkins.spring.io/view/SpringData/job/spring-data-couchbase/] https://gitter.im/spring-projects/spring-data[image:https://badges.gitter.im/spring-projects/spring-data.svg[Gitter]]
1+
= Spring Data Couchbase image:https://jenkins.spring.io/buildStatus/icon?job=spring-data-couchbase%2Fmain&subject=Build[link=https://jenkins.spring.io/view/SpringData/job/spring-data-couchbase/] 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 Couchbase"]
22

33
The primary goal of the https://www.springsource.org/spring-data[Spring Data] project is to make it easier to build
44
Spring-powered applications that use new data access technologies such as non-relational databases, map-reduce

ci/clean.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,11 @@
22

33
set -euo pipefail
44

5-
MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" \
5+
export DEVELOCITY_CACHE_USERNAME=${DEVELOCITY_CACHE_USR}
6+
export DEVELOCITY_CACHE_PASSWORD=${DEVELOCITY_CACHE_PSW}
7+
8+
# The environment variable to configure access key is still GRADLE_ENTERPRISE_ACCESS_KEY
9+
export GRADLE_ENTERPRISE_ACCESS_KEY=${DEVELOCITY_ACCESS_KEY}
10+
11+
MAVEN_OPTS="-Duser.name=spring-builds+jenkins -Duser.home=/tmp/jenkins-home" \
612
./mvnw -s settings.xml clean -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-couchbase

ci/test.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ set -euo pipefail
55
mkdir -p /tmp/jenkins-home/.m2/spring-data-couchbase
66
chown -R 1001:1001 .
77

8-
MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" \
8+
export DEVELOCITY_CACHE_USERNAME=${DEVELOCITY_CACHE_USR}
9+
export DEVELOCITY_CACHE_PASSWORD=${DEVELOCITY_CACHE_PSW}
10+
11+
# The environment variable to configure access key is still GRADLE_ENTERPRISE_ACCESS_KEY
12+
export GRADLE_ENTERPRISE_ACCESS_KEY=${DEVELOCITY_ACCESS_KEY}
13+
14+
MAVEN_OPTS="-Duser.name=spring-builds+jenkins -Duser.home=/tmp/jenkins-home" \
915
./mvnw -s settings.xml \
1016
-P${PROFILE} clean dependency:list test -Dsort -Dbundlor.enabled=false -U -B -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-couchbase

0 commit comments

Comments
 (0)