Skip to content

Commit

Permalink
clone: clones of disabled jobs now stay disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
yonatanp committed Dec 15, 2013
1 parent f02f673 commit abefd43
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/groovy/com/entagen/jenkins/JenkinsApi.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,12 @@ class JenkinsApi {
post('createItem', missingJobConfig, [name: missingJob.jobName, mode: 'copy', from: templateJob.jobName], ContentType.XML)

post('job/' + missingJob.jobName + "/config.xml", missingJobConfig, [:], ContentType.XML)
//Forced diable enable to work around Jenkins' automatic disabling of clones jobs
//Forced disable enable to work around Jenkins' automatic disabling of clones jobs
//But only if the original job was enabled
post('job/' + missingJob.jobName + '/disable')
post('job/' + missingJob.jobName + '/enable')
if (!missingJobConfig.contains("<disabled>true</disabled>")) {
post('job/' + missingJob.jobName + '/enable')
}
}

void startJob(ConcreteJob job) {
Expand Down

0 comments on commit abefd43

Please sign in to comment.