Browse Source

Обновить 'Jenkinsfile'

Vladimir Tomishinets 6 years ago
parent
commit
4a68c821a6
1 changed files with 3 additions and 3 deletions
  1. 3 3
      Jenkinsfile

+ 3 - 3
Jenkinsfile

@@ -93,8 +93,8 @@ pipeline {
              """
           def NODE = sh (script: "DOCKER_HOST=tcp://${CLUSTERS.get((ENAMES[1]))}:2376 DOCKER_TLS_VERIFY=1 docker service ps \${SERVICE_NAME} --format '{{.Node}}' --filter desired-state=Running" , returnStdout: true).trim()
           echo "${NODE}"
-          sh """container_id_client=\$(docker run -e mode=client -e server=${NODE} --privileged -d --rm  ${DOCKER_IMAGE}:${SERIAL})
-                docker exec -t \${container_id_client} ping -c 3 -q 10.10.20.1
+          def CONTAINER_ID_CLIENT = sh script: "docker run -e mode=client -e server=${NODE} --privileged -d --rm  ${DOCKER_IMAGE}:${SERIAL}" , returnStdout: true
+          sh """docker exec -t \${CONTAINER_ID_CLIENT} ping -c 3 -q 10.10.20.1
                 if [ \$? != 0 ]; then exit 1; else echo 'OVPN_RSA is working!!!'; fi
              """
              
@@ -128,7 +128,7 @@ pipeline {
   }
   post {
     always {
-      sh "docker stop \${container_id_client}"
+      sh "docker stop \${CONTAINER_ID_CLIENT}"
       sh "DOCKER_HOST=tcp://${CLUSTERS.get((ENAMES[1]))}:2376 DOCKER_TLS_VERIFY=1 docker stack rm ${SERVICE_NAME}"
       echo "CleaningUp work directory"
       deleteDir()