node('<Node Name>') {
stage("<Stage Name>") {
try {
// Your logic/code
} catch (Exception ex) {
// depends what you want to do with the exception
// You can even suppress the exception means not to fail the build
// or do something and than throw it
} finally {
// whatever you will put here will always gets executed
}
}
}
1条答案
按热度按时间owfi6suc1#
使用try/catch/finally的脚本化管道的简单示例。