I need to get result of current build execution in postBuildScripts shell call in my Jenkins DSL script. Like ${currentBuild.currentResult}
in Jenkins pipelines with values: SUCCESS, UNSTABLE, or FAILURE
I've searched through DSL doc but havent found any solution for that.
My code is something like this:
postBuildScripts {
steps {
shell("""echo \$CURRENT_BUILD_STATUS""")
}
}
So how to get this $CURRENT_BUILD_STATUS
in easiest way?
Unfortunately the documentation of the PostBuildScript plugin is missing some interesting parts...
job('example') {
publishers {
postBuildScripts {
steps {
shell('echo $BUILD_RESULT')
}
}
}
}
您可以使用环境变量$ BUILD_STATUS
echo $BUILD_STATUS
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.