Ver código fonte

change Jenkinsfile

Tomishinets Vladimir 4 anos atrás
pai
commit
91e88aee9e
1 arquivos alterados com 8 adições e 7 exclusões
  1. 8 7
      prodK8s.Jenkinsfile

+ 8 - 7
prodK8s.Jenkinsfile

@@ -4,6 +4,7 @@ pipeline {
   options {
     buildDiscarder logRotator(numToKeepStr: '10')
     disableConcurrentBuilds()
+    timeout(time: 10, unit: 'MINUTES')
   }
   agent {
     kubernetes {
@@ -20,11 +21,11 @@ pipeline {
     APP_GIT_URL='ssh://git@git.sdsys.ru:8022/iru/admin.git'
     JENKINS_MAIL='jenkins.dev@sdsys.ru'
     DOCKER_REGISTRY='jcr.infoclinica.ru'
-    RELEASENAME=''
-    APP_DIR=''
+    CHART_NAME=''
+    CHART_PATH=''
+    PROJECT=''
     HELM_DIR=''
     TAG=''
-    CHART_PATH=''
   }
   parameters {
     string(
@@ -41,6 +42,7 @@ pipeline {
           gitOps.clone(HELM_GIT_URL)
           HELM_DIR = dirOps.calculateDir(HELM_GIT_URL)
           CHART_PATH = "${HELM_DIR}/${CHART_SUBPATH}"
+          PROJECT = DOCKER_IMAGE.split("/")[1]
         }
       }
     }
@@ -48,11 +50,10 @@ pipeline {
       steps {
         script {
           echo "Update values.yaml"
-          APP_DIR = dirOps.calculateDir(APP_GIT_URL)
           def data = readYaml file: "${CHART_PATH}/values.yaml"
-          TAG_PATH = "images.${APP_DIR}.dev"
+          TAG_PATH = "images.${PROJECT}.dev"
           TAG = yamlOps.getBuilder(TAG_PATH, data)
-          TAG_PATH = "images.${APP_DIR}.prod"
+          TAG_PATH = "images.${PROJECT}.prod"
           yamlOps.updateBuilder(TAG_PATH, data, TAG)
           writeYaml file: "${CHART_PATH}/values.yaml", data: data, overwrite: true
         }
@@ -78,7 +79,7 @@ pipeline {
       steps {
         script {
           echo "Push changes to Repo"
-          COMMIT = "Version update ${APP_DIR}"
+          COMMIT = "Version update ${PROJECT}"
           gitOps.push(HELM_DIR, COMMIT)
         }
       }