Skip to content

Commit

Permalink
Allow to pass string to start-on-create (address incompatibilies)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreineculau committed Aug 1, 2015
1 parent 3514663 commit 1ee358d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/groovy/com/entagen/jenkins/JenkinsApi.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,16 @@ class JenkinsApi {
}

void startJob(ConcreteJob job, String method) {
// Handle method being startOnCreate for backward compatibility
if (method == "true" || method == "1") {
method = "build"
} else if (method == "false" || method == "0") {
method = ""
}
if (method) {
println "Starting job ${job.jobName}: ${method}"
post('job/' + job.jobName + '/' + method)
}
println "Starting job ${job.jobName}."
post('job/' + job.jobName + '/' + method)
}

String configForMissingJob(ConcreteJob missingJob, List<TemplateJob> templateJobs) {
Expand Down

0 comments on commit 1ee358d

Please sign in to comment.