move releaseworkflow vars to params
Related-prod: 31339

Change-Id: I00495ccd2aa968a9597d6fc2be3e95185797d07e
diff --git a/src/com/mirantis/mk/ReleaseWorkflow.groovy b/src/com/mirantis/mk/ReleaseWorkflow.groovy
index 7baeb22..8fe21ae 100644
--- a/src/com/mirantis/mk/ReleaseWorkflow.groovy
+++ b/src/com/mirantis/mk/ReleaseWorkflow.groovy
@@ -7,9 +7,14 @@
 
 /**
  * Update release metadata after image build
+ *
+ * @param key metadata key
+ * @param value metadata value
+ * @param image image name
+ * @param imageRelease image release name
  */
 
-def updateReleaseMetadata(){
+def updateReleaseMetadata(key, value, image, imageRelease){
     def python = new com.mirantis.mk.Python()
     def gerrit = new com.mirantis.mk.Gerrit()
     def git = new com.mirantis.mk.Git()
@@ -38,7 +43,7 @@
             }
         }
         stage('Cloning release-metadata repository') {
-            git.checkoutGitRepository(repoDir, METADATA_REPO_URL, METADATA_GERRIT_BRANCH, CREDENTIALS_ID, true, 10, 0)
+            git.checkoutGitRepository(repoDir, env["METADATA_REPO_URL"], env["METADATA_GERRIT_BRANCH"], env["CREDENTIALS_ID"], true, 10, 0)
             dir(repoDir) {
                 gitRemote = sh(
                         script:
@@ -71,8 +76,7 @@
 
                 for (component in resultBuiltImages[openstackRelease].keySet()) {
                     resultBuiltImages[openstackRelease][component].each {
-                        //runReleaseMetadataApp(venvDir, repoDir, metadataDir, "update", "images:openstack:${openstackRelease}:${component}:${it.key}", "${it.value}")
-                        cmdText = "python ${repoDir}/utils/app.py --path ${metadataDir} update --key images:openstack:${openstackRelease}:${component}:${it.key} --value ${it.value}"
+                        cmdText = "python ${repoDir}/utils/app.py --path ${metadataDir} update --key images:${image}:${imageRelease}:${component}:${key} --value ${value}"
                         python.runVirtualenvCommand(venvDir, cmdText)
                     }
                 }