Skip to content

Commit

Permalink
jenkins: also log body when starting build fails
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipj committed Jun 7, 2019
1 parent e782b55 commit 7ced2a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/trigger-jenkins-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ function triggerBuild (options, cb) {
headers: { authorization },
qs: { token: buildAuthToken },
json: { parameters: buildParametersForRepo(options, repo) }
}, (err, response) => {
}, (err, response, body) => {
if (err) {
return cb(err)
} else if (response.statusCode !== 200) {
return cb(new Error(`Expected 200 from Jenkins, got ${response.statusCode}`))
return cb(new Error(`Expected 200 from Jenkins, got ${response.statusCode}: ${body}`))
}

cb(null, { jobName, jobId: response.body.id })
Expand Down

0 comments on commit 7ced2a7

Please sign in to comment.