Skip to content

Commit cfeedc8

Browse files
committed
Add Develocity build scan + build cache to Jenkins build
1 parent 1e95a8a commit cfeedc8

File tree

1 file changed

+24
-18
lines changed

1 file changed

+24
-18
lines changed

Jenkinsfile

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -155,29 +155,35 @@ stage('Build') {
155155
stage('Test') {
156156
String cmd = "./ci/build.sh ${buildEnv.additionalOptions ?: ''} ${state[buildEnv.tag]['additionalOptions'] ?: ''}"
157157
withEnv(["RDBMS=${buildEnv.dbName}"]) {
158-
try {
159-
if (buildEnv.dbLockableResource == null) {
160-
withCredentials([file(credentialsId: 'sybase-jconnect-driver', variable: 'jconnect_driver')]) {
161-
sh 'cp -f $jconnect_driver ./drivers/jconn4.jar'
162-
timeout( [time: buildEnv.longRunning ? 480 : 120, unit: 'MINUTES'] ) {
163-
sh cmd
158+
withCredentials([string(credentialsId: helper.scmSource.pullRequest ?
159+
'ge.hibernate.org-access-key-pr' : 'ge.hibernate.org-access-key',
160+
variable: 'GRADLE_ENTERPRISE_ACCESS_KEY')]) {
161+
withGradle { // withDevelocity, actually: https://plugins.jenkins.io/gradle/#plugin-content-capturing-build-scans-from-jenkins-pipeline
162+
try {
163+
if (buildEnv.dbLockableResource == null) {
164+
withCredentials([file(credentialsId: 'sybase-jconnect-driver', variable: 'jconnect_driver')]) {
165+
sh 'cp -f $jconnect_driver ./drivers/jconn4.jar'
166+
timeout( [time: buildEnv.longRunning ? 480 : 120, unit: 'MINUTES'] ) {
167+
sh cmd
168+
}
169+
}
164170
}
165-
}
166-
}
167-
else {
168-
lock(label: buildEnv.dbLockableResource, quantity: 1, variable: 'LOCKED_RESOURCE') {
169-
if ( buildEnv.dbLockResourceAsHost ) {
170-
cmd += " -DdbHost=${LOCKED_RESOURCE}"
171-
}
172-
timeout( [time: buildEnv.longRunning ? 480 : 120, unit: 'MINUTES'] ) {
173-
sh cmd
171+
else {
172+
lock(label: buildEnv.dbLockableResource, quantity: 1, variable: 'LOCKED_RESOURCE') {
173+
if ( buildEnv.dbLockResourceAsHost ) {
174+
cmd += " -DdbHost=${LOCKED_RESOURCE}"
175+
}
176+
timeout( [time: buildEnv.longRunning ? 480 : 120, unit: 'MINUTES'] ) {
177+
sh cmd
178+
}
179+
}
174180
}
175181
}
182+
finally {
183+
junit '**/target/test-results/test/*.xml,**/target/test-results/testKitTest/*.xml'
184+
}
176185
}
177186
}
178-
finally {
179-
junit '**/target/test-results/test/*.xml,**/target/test-results/testKitTest/*.xml'
180-
}
181187
}
182188
}
183189
}

0 commit comments

Comments
 (0)