Browse Source

Обновить 'Jenkinsfile'

Vladimir Tomishinets 6 years ago
parent
commit
ef09e25bc8
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Jenkinsfile

+ 2 - 2
Jenkinsfile

@@ -93,7 +93,7 @@ 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}"
-          def CONTAINER_ID_CLIENT = sh script: "docker run -e mode=client -e server=${NODE} --privileged -d --rm  ${DOCKER_IMAGE}:${SERIAL}" , returnStdout: true
+          def CONTAINER_ID_CLIENT = sh script: "docker run --name ${DOCKER_IMAGE} -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 ${DOCKER_IMAGE}"
       sh "DOCKER_HOST=tcp://${CLUSTERS.get((ENAMES[1]))}:2376 DOCKER_TLS_VERIFY=1 docker stack rm ${SERVICE_NAME}"
       echo "CleaningUp work directory"
       deleteDir()