From cb1ebdb3d5d0fba21a9c7ed000fc8225ebc0530e Mon Sep 17 00:00:00 2001 From: Eric Haag Date: Mon, 5 Aug 2024 03:54:42 -0500 Subject: [PATCH] Migrate build to Spring Develocity Conventions extension. * Migrate build to Spring Develocity Conventions extension. * Adopt Develocity environment variables. Closes #1508 --- .gitignore | 2 +- .mvn/extensions.xml | 11 +++-------- .mvn/gradle-enterprise.xml | 31 ------------------------------- Jenkinsfile | 16 ---------------- ci/pipeline.properties | 1 - 5 files changed, 4 insertions(+), 57 deletions(-) delete mode 100644 .mvn/gradle-enterprise.xml diff --git a/.gitignore b/.gitignore index 2a81d4ed0..a6fda67ca 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,4 @@ build/ node_modules node package-lock.json -.mvn/.gradle-enterprise +.mvn/.develocity diff --git a/.mvn/extensions.xml b/.mvn/extensions.xml index ebd761025..1e3bb355f 100644 --- a/.mvn/extensions.xml +++ b/.mvn/extensions.xml @@ -1,13 +1,8 @@ - com.gradle - gradle-enterprise-maven-extension - 1.19.2 - - - com.gradle - common-custom-user-data-maven-extension - 1.12.4 + io.spring.develocity.conventions + develocity-conventions-maven-extension + 0.0.19 diff --git a/.mvn/gradle-enterprise.xml b/.mvn/gradle-enterprise.xml deleted file mode 100644 index c24406314..000000000 --- a/.mvn/gradle-enterprise.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - https://ge.spring.io - - - false - true - true - - #{{'0.0.0.0'}} - - - - - true - - - - - ${env.DEVELOCITY_CACHE_USERNAME} - ${env.DEVELOCITY_CACHE_PASSWORD} - - - true - #{env['DEVELOCITY_CACHE_USERNAME'] != null and env['DEVELOCITY_CACHE_PASSWORD'] != null} - - - diff --git a/Jenkinsfile b/Jenkinsfile index a99c8dea5..6ac62d2ff 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,7 +29,6 @@ pipeline { } agent { label 'data' } options { timeout(time: 30, unit: 'MINUTES') } - steps { script { def image = docker.build("springci/spring-data-with-cassandra-3.11:${p['java.main.tag']}", "--build-arg BASE=${p['docker.java.main.image']} --build-arg CASSANDRA=${p['docker.cassandra.3.version']} ci/openjdk17-8-cassandra-3.11/") @@ -48,7 +47,6 @@ pipeline { } agent { label 'data' } options { timeout(time: 30, unit: 'MINUTES') } - steps { script { def image = docker.build("springci/spring-data-with-cassandra-3.11:${p['java.next.tag']}", "--build-arg BASE=${p['docker.java.next.image']} --build-arg CASSANDRA=${p['docker.cassandra.3.version']} ci/openjdk21-8-cassandra-3.11/") @@ -75,7 +73,6 @@ pipeline { options { timeout(time: 30, unit: 'MINUTES') } environment { ARTIFACTORY = credentials("${p['artifactory.credentials']}") - DEVELOCITY_CACHE = credentials("${p['develocity.cache.credentials']}") DEVELOCITY_ACCESS_KEY = credentials("${p['develocity.access-key']}") } steps { @@ -85,9 +82,6 @@ pipeline { sh 'mkdir -p /tmp/jenkins-home' sh 'JAVA_HOME=/opt/java/openjdk8 /opt/cassandra/bin/cassandra -R &' sh 'MAVEN_OPTS="-Duser.name=' + "${p['jenkins.user.name']}" + ' -Duser.home=/tmp/jenkins-home" ' + - "DEVELOCITY_CACHE_USERNAME=${DEVELOCITY_CACHE_USR} " + - "DEVELOCITY_CACHE_PASSWORD=${DEVELOCITY_CACHE_PSW} " + - "GRADLE_ENTERPRISE_ACCESS_KEY=${DEVELOCITY_ACCESS_KEY} " + "./mvnw -s settings.xml -Pci,external-cassandra " + "clean dependency:list verify -Dsort -U -B" } @@ -112,7 +106,6 @@ pipeline { options { timeout(time: 30, unit: 'MINUTES') } environment { ARTIFACTORY = credentials("${p['artifactory.credentials']}") - DEVELOCITY_CACHE = credentials("${p['develocity.cache.credentials']}") DEVELOCITY_ACCESS_KEY = credentials("${p['develocity.access-key']}") } steps { @@ -122,9 +115,6 @@ pipeline { sh 'mkdir -p /tmp/jenkins-home' sh 'JAVA_HOME=/opt/java/openjdk8 /opt/cassandra/bin/cassandra -R &' sh 'MAVEN_OPTS="-Duser.name=' + "${p['jenkins.user.name']}" + ' -Duser.home=/tmp/jenkins-home" ' + - "DEVELOCITY_CACHE_USERNAME=${DEVELOCITY_CACHE_USR} " + - "DEVELOCITY_CACHE_PASSWORD=${DEVELOCITY_CACHE_PSW} " + - "GRADLE_ENTERPRISE_ACCESS_KEY=${DEVELOCITY_ACCESS_KEY} " + "./mvnw -s settings.xml -Pci,external-cassandra " + "clean dependency:list verify -Dsort -U -B" } @@ -147,22 +137,16 @@ pipeline { label 'data' } options { timeout(time: 20, unit: 'MINUTES') } - environment { ARTIFACTORY = credentials("${p['artifactory.credentials']}") - DEVELOCITY_CACHE = credentials("${p['develocity.cache.credentials']}") DEVELOCITY_ACCESS_KEY = credentials("${p['develocity.access-key']}") } - steps { script { docker.withRegistry(p['docker.proxy.registry'], p['docker.proxy.credentials']) { docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.basic']) { sh 'mkdir -p /tmp/jenkins-home' sh 'MAVEN_OPTS="-Duser.name=' + "${p['jenkins.user.name']}" + ' -Duser.home=/tmp/jenkins-home" ' + - "DEVELOCITY_CACHE_USERNAME=${DEVELOCITY_CACHE_USR} " + - "DEVELOCITY_CACHE_PASSWORD=${DEVELOCITY_CACHE_PSW} " + - "GRADLE_ENTERPRISE_ACCESS_KEY=${DEVELOCITY_ACCESS_KEY} " + "./mvnw -s settings.xml -Pci,artifactory " + "-Dartifactory.server=${p['artifactory.url']} " + "-Dartifactory.username=${ARTIFACTORY_USR} " + diff --git a/ci/pipeline.properties b/ci/pipeline.properties index 824563a21..dea835720 100644 --- a/ci/pipeline.properties +++ b/ci/pipeline.properties @@ -31,6 +31,5 @@ docker.proxy.credentials=usw1_packages_broadcom_com-jenkins-token artifactory.credentials=02bd1690-b54f-4c9f-819d-a77cb7a9822c artifactory.url=https://repo.spring.io artifactory.repository.snapshot=libs-snapshot-local -develocity.cache.credentials=gradle_enterprise_cache_user develocity.access-key=gradle_enterprise_secret_access_key jenkins.user.name=spring-builds+jenkins