Skip to content

Commit

Permalink
Merge pull request entagen#50 from yonatanp/master
Browse files Browse the repository at this point in the history
clone: clones of disabled jobs now stay disabled
  • Loading branch information
jamesdh committed Mar 31, 2014
2 parents 451281d + abefd43 commit 364d170
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 364d170

Please sign in to comment.