Parcourir la source

Code optimization errors

Vadim Surkov il y a 6 ans
Parent
commit
d5ab45bb71
1 fichiers modifiés avec 6 ajouts et 8 suppressions
  1. 6 8
      Jenkinsfile

+ 6 - 8
Jenkinsfile

@@ -80,12 +80,10 @@ pipeline {
             }
             catch(err){
               echo "Recovering service $item"
-              withEnv(["service_name=${item}","clustername=${CLUSTER_TGT}"]) {
-                  sh '''export DOCKER_CERT_PATH=/run/secrets/swarm
-                        export DOCKER_HOST=tcp://${clustername}:2376 DOCKER_TLS_VERIFY=1
-                        docker service rollback ${service_name}
-                     '''
-              }
+              sh """export DOCKER_CERT_PATH=/run/secrets/swarm
+                    export DOCKER_HOST=tcp://${CLUSTER_TGT}:2376 DOCKER_TLS_VERIFY=1
+                    docker service rollback ${item}
+                 """
               throw err
             }
           }
@@ -99,7 +97,7 @@ pipeline {
                docker push ${DOCKER_REGISTRY}/iru/${DOCKER_IMAGE}:latest """
         echo "Updating tag info in ${SWARM_GIT_NAME} repository"
         withCredentials([sshUserPrivateKey(credentialsId: 'provision', keyFileVariable: 'GIT_SSH_KEY', passphraseVariable: '', usernameVariable: 'GIT_SSH_USERNAME')]) {
-          sh '''GIT_SSH_COMMAND='ssh -i ${GIT_SSH_KEY} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' \
+          sh """GIT_SSH_COMMAND='ssh -i ${GIT_SSH_KEY} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' \
                   git clone ${SWARM_GIT_URL}
                 cd ${SWARM_GIT_NAME}
                 echo -n ${NEWTAG} > tags/${DOCKER_IMAGE}.version
@@ -109,7 +107,7 @@ pipeline {
                 git commit -m 'Version update'
                 GIT_SSH_COMMAND='ssh -i ${GIT_SSH_KEY} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' \
                   git push origin master
-                ls'''
+                ls"""
         }
       }
     }