Skip to content

Commit

Permalink
Ignore failures of gerritReview on CloudBees CI
Browse files Browse the repository at this point in the history
On the CloudBees hosted Jenkins CI the gerrit-code-review
plugin isn't installed and thus the gerritReview step is
not available.

Change-Id: I2c0721bbc1c57010ce4e1ab420517ff58651de64
  • Loading branch information
lucamilanesio committed Nov 6, 2018
1 parent e56507d commit b889d1c
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,20 @@

// Test plugin compatbility to latest Jenkins LTS
// Allow failing tests to retry execution
buildPlugin(jenkinsVersions: [null, '2.60.1'], failFast: false)
try {
buildPlugin(jenkinsVersions: [null, '2.60.1'], failFast: false, platforms: ['linux'])
if (currentBuild.result == 'UNSTABLE') {
review labels: [Verified: 0], message: "Build is unstable, there are failed tests ${env.BUILD_URL}"
} else {
review labels: [Verified: +1], message: "Build succeeded ${env.BUILD_URL}"
}
} catch (e) {
review labels: [Verified: -1], message: "Build failed ${env.BUILD_URL}"
}

def review(labels, message) {
try {
gerritReview labels: labels, message: message
} catch (NoSuchMethodError e) {
}
}

0 comments on commit b889d1c

Please sign in to comment.