Explorar el Código

Modify always action in Jenkinsfile

Wadim Surkov hace 6 años
padre
commit
2ac536a45a
Se han modificado 1 ficheros con 4 adiciones y 3 borrados
  1. 4 3
      Jenkinsfile

+ 4 - 3
Jenkinsfile

@@ -119,11 +119,12 @@ pipeline {
   }
   post {
     always {
-      sh "docker stop ${CONTAINER_ID_CLIENT}"
-      sh "docker stop ${CONTAINER_ID_SERVER}"
-      sh "docker image rm ${DOCKER_IMAGE}:${SERIAL}"
       echo "CleaningUp work directory"
       deleteDir()
+      sh """docker stop ${CONTAINER_ID_CLIENT}
+            docker stop ${CONTAINER_ID_SERVER}
+            docker image rm ${DOCKER_IMAGE}:${SERIAL}
+         """
     }
     failure {
       mail charset: 'UTF-8',