Added pipelines previously defined in mk-ci-salt-model
Change-Id: Id759cf59d029b3d7d9e1fbd13abf875b6737ebc4
diff --git a/git-mirror-2way-pipeline.groovy b/git-mirror-2way-pipeline.groovy
new file mode 100644
index 0000000..0b7e023
--- /dev/null
+++ b/git-mirror-2way-pipeline.groovy
@@ -0,0 +1,29 @@
+def common = new com.mirantis.mk.Common()
+stage("Mirror") {
+ node() {
+ try{
+ def branches = BRANCHES.tokenize(',')
+ def pollBranches = []
+ for (i=0; i < branches.size; i++) {
+ pollBranches.add([name:branches[i]])
+ }
+ dir("target") {
+ checkout changelog: true, poll: true,
+ scm: [$class: 'GitSCM', branches: pollBranches, doGenerateSubmoduleConfigurations: false, submoduleCfg: [],
+ extensions: [[$class: 'CleanCheckout']], submoduleCfg: [], userRemoteConfigs: [[credentialsId: CREDENTIALS_ID, url: TARGET_URL]]]
+ }
+ dir("source") {
+ checkout changelog: true, poll: true,
+ scm: [$class: 'GitSCM', branches: pollBranches, doGenerateSubmoduleConfigurations: false,
+ extensions: [[$class: 'CleanCheckout']], submoduleCfg: [], userRemoteConfigs: [[credentialsId: CREDENTIALS_ID, url: SOURCE_URL]]]
+ common.mirrorGit(SOURCE_URL, TARGET_URL, CREDENTIALS_ID, BRANCHES, true, true, false)
+ }
+ } catch (Throwable e) {
+ // If there was an error or exception thrown, the build failed
+ currentBuild.result = "FAILURE"
+ throw e
+ } finally {
+ common.sendNotification(currentBuild.result,"",["slack"])
+ }
+ }
+}
\ No newline at end of file