瀏覽代碼

Modify always action in Jenkinsfile

Wadim Surkov 6 年之前
父節點
當前提交
2ac536a45a
共有 1 個文件被更改,包括 4 次插入3 次删除
  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',