Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在声明式管道中,无法使用 try{} catch{} 方法来解析阶段的结果。我需要根据 sh 脚本的输出将状态设置为 UNSTABLE,知道如何实现吗?
您可以在声明式管道中使用 Post-steps 功能。例如:
pipeline { stages { stage('some stage') { steps {} } } post { always { // here you can process the output of Shell script and set the build status } success { //Only Success Scenarios } failure { //Only when Failure happens } } }