| def common = new com.mirantis.mk.Common() |
| def git = new com.mirantis.mk.Git() |
| def branches = BRANCHES.tokenize(',') |
| for (i=0; i < branches.size; i++) { |
| pollBranches.add([name:branches[i]]) |
| checkout changelog: true, poll: true, |
| scm: [$class: 'GitSCM', branches: pollBranches, doGenerateSubmoduleConfigurations: false, submoduleCfg: [], |
| extensions: [[$class: 'CleanCheckout']], submoduleCfg: [], userRemoteConfigs: [[credentialsId: CREDENTIALS_ID, url: TARGET_URL]]] |
| checkout changelog: true, poll: true, |
| scm: [$class: 'GitSCM', branches: pollBranches, doGenerateSubmoduleConfigurations: false, |
| extensions: [[$class: 'CleanCheckout']], submoduleCfg: [], userRemoteConfigs: [[credentialsId: CREDENTIALS_ID, url: SOURCE_URL]]] |
| git.mirrorGit(SOURCE_URL, TARGET_URL, CREDENTIALS_ID, BRANCHES, true, true, false) |
| // If there was an error or exception thrown, the build failed |
| currentBuild.result = "FAILURE" |
| common.sendNotification(currentBuild.result,"",["slack"]) |