美文网首页
jenkins pipeline try/catch/fina

jenkins pipeline try/catch/fina

作者: _fishman | 来源:发表于2020-06-23 10:56 被阅读0次
    pipeline {
        agent { node { label "master" }}
        stages {
            stage('test') {
                steps {
                    script {
                            try {
                                sh "pwd"
                            } catch (Exception err) {
                                echo 'test failed'
                                currentBuild.result = 'FAILURE'
                            } finally {
                                cleanWs()
                            }
                    }
                }
            }
        }
    }
    

    相关文章

      网友评论

          本文标题:jenkins pipeline try/catch/fina

          本文链接:https://www.haomeiwen.com/subject/rwbcfktx.html