script{
build job : 'somejob',
parameters: [
extendedChoice(name: 'some_choice', value: "${env.some_choice}")
],
propagate: false
}
echo "${currentBuild.Currentresult}
如何在上述说明性管道中获取构建作业的状态
${currentBuild.Currentresult}
总是返回成功
答案 0 :(得分:0)
只需将其作为currentBuild访问。例如,在我的代码中,我将buildStatus传递给如下所示的库:
stage('notify') {
steps {
script {
echo "end!!"
slackHelper.finalBuildStatusMessage(currentBuild)
slackSend(channel: '#ci-cd', attachments: slackHelper.getFinalSlackMessage())
}
}
}