From 1ee358da2e3a44702a3ac6846966068d66305eca Mon Sep 17 00:00:00 2001 From: Andrei Neculau Date: Sat, 1 Aug 2015 13:05:06 +0200 Subject: [PATCH] Allow to pass string to start-on-create (address incompatibilies) --- src/main/groovy/com/entagen/jenkins/JenkinsApi.groovy | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/groovy/com/entagen/jenkins/JenkinsApi.groovy b/src/main/groovy/com/entagen/jenkins/JenkinsApi.groovy index ac6c6709..ddbb130f 100644 --- a/src/main/groovy/com/entagen/jenkins/JenkinsApi.groovy +++ b/src/main/groovy/com/entagen/jenkins/JenkinsApi.groovy @@ -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 templateJobs) {