Tomishinets Vladimir 4 yıl önce
ebeveyn
işleme
30986b2a8b
1 değiştirilmiş dosya ile 2 ekleme ve 5 silme
  1. 2 5
      devK8s.Jenkinsfile

+ 2 - 5
devK8s.Jenkinsfile

@@ -19,8 +19,6 @@ pipeline {
     APP_GIT_URL='ssh://git@git.sdsys.ru:8022/iru/node.git'
     JENKINS_MAIL='jenkins.dev@sdsys.ru'
     DOCKER_REGISTRY='images.sdsys.ru'
-    PROJECT=''
-    CHART_NAME=''
     CHART_PATH=''
     HELM_DIR=''
     IMAGE_TO_PUSH=''
@@ -45,9 +43,7 @@ pipeline {
           gitOps.clone(HELM_GIT_URL)
           echo "Defining variables"
           HELM_DIR = dirOps.calculateDir(HELM_GIT_URL)
-          SUB_PATH = ''
           CHART_PATH = HELM_DIR + "/helm/" + DOCKER_IMAGE.split("/")[0]
-          PROJECT = DOCKER_IMAGE.split("/")[1]
           VALUES_FILE = "${CHART_PATH}/dev.yaml"
           IMAGE_TO_PUSH = "${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${repo}-${BUILD_NUMBER}"
         }
@@ -65,7 +61,7 @@ pipeline {
     stage("Update Helm Chart") {
       steps {
         script {
-          TAG_PATH = "images.${PROJECT}"
+          TAG_PATH = "images." + DOCKER_IMAGE.split("/")[1]
           echo "Update ${TAG_PATH} to ${IMAGE_TO_PUSH} in ${VALUES_FILE}"
           def data = readYaml file: "${VALUES_FILE}"
           yamlOps.updateBuilder(TAG_PATH, data, IMAGE_TO_PUSH)
@@ -95,6 +91,7 @@ pipeline {
       steps {
         script {
           echo "Push changes to Repo"
+          PROJECT = DOCKER_IMAGE.split("/")[1]
           COMMIT = "Version update ${PROJECT}"
           gitOps.push(HELM_DIR, COMMIT)
         }