Tomishinets Vladimir 3 gadi atpakaļ
vecāks
revīzija
56f8e0cd90
1 mainītis faili ar 24 papildinājumiem un 31 dzēšanām
  1. 24 31
      Jenkinsfile-dev

+ 24 - 31
Jenkinsfile-dev

@@ -9,13 +9,6 @@ pipeline {
     timeout(time: 20, unit: 'MINUTES')
   }
   environment {
-    SERVICE_NAME_SDK='info_promo-sdk'
-    DOCKER_IMAGE_SDK='iru/promo-sdk'
-    GIT_REPO_SDK='git@github.com:icruportal/web-sdk-demo.git'
-    SERVICE_NAME_SEO='info_promo-seo'
-    DOCKER_IMAGE_SEO='iru/promo-seo'
-    GIT_REPO_SEO='git@github.com:icruportal/web-registration.git'
-    DOCKER_FILE_SEO='Dockerfile-promo-seo'
     SWARM_GIT_URL='ssh://git@git.sdsys.ru:8022/iru/stack-deploy.git'
     SWARM_GIT_NAME='stack-deploy'
     JENKINS_MAIL='jenkins@sdsys.ru'
@@ -66,30 +59,30 @@ pipeline {
         }
       }
     }
-    // stage("Build") {
-    //   steps {
-    //     script {
-    //       echo "Building ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${BUILD_NUMBER}."
-    //       withCredentials([sshUserPrivateKey(credentialsId: 'provision', keyFileVariable: 'GIT_SSH_KEY', passphraseVariable: '', usernameVariable: 'GIT_SSH_USERNAME')]) {
-    //         sh """set +x
-    //               cat ${GIT_SSH_KEY} > ${WORKSPACE}/id_rsa
-    //               chmod 600 ${WORKSPACE}/id_rsa
-    //            """
-    //       }
-    //       sh "docker build --build-arg branch=${branch} --build-arg git_repo=${REPO} --no-cache -t ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${BUILD_NUMBER} -f ./${DOCKER_FILE} ."
-    //       NEWTAG = sh(script: "docker run --rm ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${BUILD_NUMBER} cat /tmp/version 2> /dev/null", returnStdout: true).trim()
-    //       NEWTAG = branch + "-" + NEWTAG + "_" + BUILD_NUMBER
-    //       echo "NEWTAG is $NEWTAG"
-    //       sh "docker tag ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${BUILD_NUMBER} ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${NEWTAG}"
-    //     }
-    //   }
-    // }
-    // stage("Publish") {
-    //   steps {
-    //     echo "Publishing ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${NEWTAG}"
-    //     sh "docker push ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${NEWTAG}"
-    //   }
-    // }
+    stage("Build") {
+      steps {
+        script {
+          echo "Building ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${BUILD_NUMBER}."
+          withCredentials([sshUserPrivateKey(credentialsId: 'provision', keyFileVariable: 'GIT_SSH_KEY', passphraseVariable: '', usernameVariable: 'GIT_SSH_USERNAME')]) {
+            sh """set +x
+                  cat ${GIT_SSH_KEY} > ${WORKSPACE}/id_rsa
+                  chmod 600 ${WORKSPACE}/id_rsa
+               """
+          }
+          sh "docker build --build-arg branch=${branch} --build-arg git_repo=${REPO} --no-cache -t ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${BUILD_NUMBER} -f ./${DOCKER_FILE} ."
+          NEWTAG = sh(script: "docker run --rm ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${BUILD_NUMBER} cat /tmp/version 2> /dev/null", returnStdout: true).trim()
+          NEWTAG = branch + "-" + NEWTAG + "_" + BUILD_NUMBER
+          echo "NEWTAG is $NEWTAG"
+          sh "docker tag ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${BUILD_NUMBER} ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${NEWTAG}"
+        }
+      }
+    }
+    stage("Publish") {
+      steps {
+        echo "Publishing ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${NEWTAG}"
+        sh "docker push ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${NEWTAG}"
+      }
+    }
     // stage("Update") {
     //   steps {
     //     script {