Explorar o código

Jenkinsfile错误处理修改

huqi %!s(int64=5) %!d(string=hai) anos
pai
achega
1ff235fbeb
Modificáronse 1 ficheiros con 2 adicións e 6 borrados
  1. 2 6
      Jenkinsfile

+ 2 - 6
Jenkinsfile

@@ -3,12 +3,8 @@ pipeline {
     stages {
         stage('preperation') {
             steps {
-                script {
-                    try {
-                        sh 'target/o2server/stop_linux.sh'
-                    } catch (err) {
-                        echo err
-                    }
+                catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
+                    sh 'target/o2server/stop_linux.sh'
                 }
                 sh 'npm install'
                 sh 'npm run preperation:linux'