Browse Source

Поправил вызов функций k8sHelmOps.upgrade и k8sHelmOps.rollback

Tomishinets Vladimir 3 years ago
parent
commit
759b84d667
2 changed files with 4 additions and 8 deletions
  1. 2 4
      updateK8s.Jenkinsfile
  2. 2 4
      updateK8sFromValuesFile.Jenkinsfile

+ 2 - 4
updateK8s.Jenkinsfile

@@ -62,16 +62,14 @@ pipeline {
     stage("Update APP") {
       steps {
         script {
-          RELEASENAME = DOCKER_IMAGE.split("/")[1]
-          NAMESPACE = DOCKER_IMAGE.split("/")[1]
           try {
             echo "Update APP"
-            k8sHelmOps.upgrade(CONTEXT, NAMESPACE, RELEASENAME, CHART_PATH, VALUES_FILE_PROD, HELM_REPO)
+            k8sHelmOps.upgrade(CONTEXT, DOCKER_IMAGE.split("/")[1], DOCKER_IMAGE.split("/")[1], CHART_PATH, VALUES_FILE_PROD, HELM_REPO)
             echo "Update success!!!"
           }
           catch(err) {
             echo "Recovering APP"
-            k8sHelmOps.rollback(CONTEXT, NAMESPACE, RELEASENAME)
+            k8sHelmOps.rollback(CONTEXT, DOCKER_IMAGE.split("/")[1], DOCKER_IMAGE.split("/")[1])
             throw err
           }
         }

+ 2 - 4
updateK8sFromValuesFile.Jenkinsfile

@@ -55,16 +55,14 @@ pipeline {
     stage("Update APP") {
       steps {
         script {
-          RELEASENAME = DOCKER_IMAGE.split("/")[1]
-          NAMESPACE = DOCKER_IMAGE.split("/")[1]
           try {
             echo "Update APP"
-            k8sHelmOps.upgrade(CONTEXT, NAMESPACE, RELEASENAME, CHART_PATH, VALUES_FILE, HELM_REPO)
+            k8sHelmOps.upgrade(CONTEXT, DOCKER_IMAGE.split("/")[1], DOCKER_IMAGE.split("/")[1], CHART_PATH, VALUES_FILE, HELM_REPO)
             echo "Update success!!!"
           }
           catch(err) {
             echo "Recovering APP"
-            k8sHelmOps.rollback(CONTEXT, NAMESPACE, RELEASENAME)
+            k8sHelmOps.rollback(CONTEXT, DOCKER_IMAGE.split("/")[1], DOCKER_IMAGE.split("/")[1])
             throw err
           }
         }