该插件不提供声明性脚本。如何将其从脚本转换为声明?
网址:https ://github.com/jenkinsci/bitbucket-build-status-notifier-plugin
...
stage 'Build'
bitbucketStatusNotify(
buildState: 'INPROGRESS',
buildKey: 'build',
buildName: 'Build',
repoSlug: 'my-awesome-project',
commitId: 'a83c709e9d514421ef614ef0a1117366c84c6304'
)
try {
myBuildFunction()
bitbucketStatusNotify(
buildState: 'SUCCESSFUL',
buildKey: 'build',
buildName: 'Build',
repoSlug: 'my-awesome-project',
commitId: 'a83c709e9d514421ef614ef0a1117366c84c6304'
)
}catch(Exception e) {
bitbucketStatusNotify(
buildState: 'FAILED',
buildKey: 'build',
buildName: 'Build',
buildDescription: 'Something went wrong with build!',
repoSlug: 'my-awesome-project',
commitId: 'a83c709e9d514421ef614ef0a1117366c84c6304'
)
}