jenkins pipeline try/catch/fina
2020-06-23 本文已影响0人
_fishman
pipeline {
agent { node { label "master" }}
stages {
stage('test') {
steps {
script {
try {
sh "pwd"
} catch (Exception err) {
echo 'test failed'
currentBuild.result = 'FAILURE'
} finally {
cleanWs()
}
}
}
}
}
}