Revert "Fix extra parameter name for test-cookiecutter/reclass-system jobs"
This reverts commit e3766cce1df5dd843625c247f7f7fb716c4b42e9.
Change-Id: I9047dd2457d041d038b3e1339266d287c7768173
diff --git a/gating-pipeline.groovy b/gating-pipeline.groovy
index c4376e8..99f487d 100644
--- a/gating-pipeline.groovy
+++ b/gating-pipeline.groovy
@@ -47,23 +47,10 @@
if (isJobExists(testJob)) {
common.infoMsg("Test job ${testJob} found, running")
def patchsetVerified = gerrit.patchsetHasApproval(gerritChange.currentPatchSet, "Verified", "+")
- // temp workaround, will be removed after full switch
- if (gerritProject == "cookiecutter-templates" || gerritProject == "reclass-system") {
- def gerritVars = '\n---'
- for (envVar in env.getEnvironment()) {
- if (envVar.key.startsWith("GERRIT_")) {
- gerritVars += "\n${envVar}"
- }
- }
- build job: testJob, parameters: [
- [$class: 'TextParameterValue', name: 'EXTRA_VARIABLES_YAML', value: gerritVars ]
- ]
- } else {
- build job: testJob, parameters: [
- [$class: 'StringParameterValue', name: 'DEFAULT_GIT_URL', value: "${GERRIT_SCHEME}://${GERRIT_NAME}@${GERRIT_HOST}:${GERRIT_PORT}/${GERRIT_PROJECT}"],
- [$class: 'StringParameterValue', name: 'DEFAULT_GIT_REF', value: GERRIT_REFSPEC]
- ]
- }
+ build job: testJob, parameters: [
+ [$class: 'StringParameterValue', name: 'DEFAULT_GIT_URL', value: "${GERRIT_SCHEME}://${GERRIT_NAME}@${GERRIT_HOST}:${GERRIT_PORT}/${GERRIT_PROJECT}"],
+ [$class: 'StringParameterValue', name: 'DEFAULT_GIT_REF', value: GERRIT_REFSPEC]
+ ]
giveVerify = true
} else {
common.infoMsg("Test job ${testJob} not found")
diff --git a/test-cookiecutter-reclass.groovy b/test-cookiecutter-reclass.groovy
index e9134e5..6813be9 100644
--- a/test-cookiecutter-reclass.groovy
+++ b/test-cookiecutter-reclass.groovy
@@ -17,10 +17,6 @@
git = new com.mirantis.mk.Git()
python = new com.mirantis.mk.Python()
-if (env.EXTRA_VARIABLES_YAML) {
- common.mergeEnv(env, env.EXTRA_VARIABLES_YAML)
-}
-
slaveNode = env.SLAVE_NODE ?: 'docker'
checkIncludeOrder = env.CHECK_INCLUDE_ORDER ?: false
diff --git a/test-system-reclass-pipeline.groovy b/test-system-reclass-pipeline.groovy
index bafd0b3..47dde97 100644
--- a/test-system-reclass-pipeline.groovy
+++ b/test-system-reclass-pipeline.groovy
@@ -1,15 +1,13 @@
def gerrit = new com.mirantis.mk.Gerrit()
def common = new com.mirantis.mk.Common()
-if (env.EXTRA_VARIABLES_YAML) {
- common.mergeEnv(env, env.EXTRA_VARIABLES_YAML)
-}
def slaveNode = env.SLAVE_NODE ?: 'python&&docker'
def gerritCredentials = env.CREDENTIALS_ID ?: 'gerrit'
def gerritRef = env.GERRIT_REFSPEC ?: null
-def defaultGitUrl = "${GERRIT_SCHEME}://${GERRIT_NAME}@${GERRIT_HOST}:${GERRIT_PORT}/${GERRIT_PROJECT}"
+def defaultGitRef = env.DEFAULT_GIT_REF ?: null
+def defaultGitUrl = env.DEFAULT_GIT_URL ?: null
def checkouted = false
def merged = false
@@ -30,8 +28,10 @@
])
systemRefspec = GERRIT_REFSPEC
}
- } else if (gerritRef && defaultGitUrl) {
- checkouted = gerrit.gerritPatchsetCheckout(defaultGitUrl, gerritRef, "HEAD", gerritCredentials)
+ // change defaultGit variables if job triggered from Gerrit
+ defaultGitUrl = "${GERRIT_SCHEME}://${GERRIT_NAME}@${GERRIT_HOST}:${GERRIT_PORT}/${GERRIT_PROJECT}"
+ } else if (defaultGitRef && defaultGitUrl) {
+ checkouted = gerrit.gerritPatchsetCheckout(defaultGitUrl, defaultGitRef, "HEAD", gerritCredentials)
}
}