post equivalent in scripted pipeline?
问题 What is the syntax of 'post' in scripted pipeline comparing to declarative pipeline? https://jenkins.io/doc/book/pipeline/syntax/#post 回答1: For scripted pipeline, everything must be written programmatically and most of the work is done in the finally block: Jenkinsfile (Scripted Pipeline): node { try { stage('Test') { sh 'echo "Fail!"; exit 1' } echo 'This will run only if successful' } catch (e) { echo 'This will run only if failed' // Since we're catching the exception in order to report on