Refactor release-mcp pipelines

  * add possibility to pass source tag for triggerDockerMirrorJob job

Change-Id: I3ad16b1ca3732f279223e18c8c15744279c80fb0
diff --git a/docker-mirror-images.groovy b/docker-mirror-images.groovy
index 08ac439..ebbfc86 100644
--- a/docker-mirror-images.groovy
+++ b/docker-mirror-images.groovy
@@ -7,6 +7,7 @@
  *   TARGET_REGISTRY                           Target Docker Registry name
  *   REGISTRY_URL                              Target Docker Registry URL
  *   IMAGE_TAG                                 Tag to use when pushing images
+ *   SOURCE_IMAGE_TAG                          Tag to use when pulling images(optional,if SOURCE_IMAGE_TAG has been found)
  *   IMAGE_LIST                                List of images to mirror
  *
  */
@@ -39,6 +40,10 @@
                     }
                     imageArray = image.trim().tokenize(' ')
                     imagePath = imageArray[0]
+                    if (imagePath.contains('SUBS_SOURCE_IMAGE_TAG')) {
+                        common.warningMsg("Replacing SUBS_SOURCE_IMAGE_TAG => ${SOURCE_IMAGE_TAG}")
+                        imagePath.replace('SUBS_SOURCE_IMAGE_TAG', SOURCE_IMAGE_TAG)
+                    }
                     targetRegistry = imageArray[1]
                     imageName = getImageName(imagePath)
                     sh """docker pull ${imagePath}
@@ -52,4 +57,4 @@
             throw e
         }
     }
-}
\ No newline at end of file
+}