Git 如何在Jenkins声明性管道中禁用bitbucket的生成通知
在多分支管道上使用此代码段时,我遇到了一个问题Git 如何在Jenkins声明性管道中禁用bitbucket的生成通知,git,jenkins,jenkins-pipeline,bitbucket,jenkins-declarative-pipeline,Git,Jenkins,Jenkins Pipeline,Bitbucket,Jenkins Declarative Pipeline,在多分支管道上使用此代码段时,我遇到了一个问题 if (currentBuild.rawBuild.getCauses().toString().contains('BranchIndexingCause')) { print "INFO: Build skipped due to trigger being Branch Indexing" currentBuild.result = 'ABORTED' // optional, gives a better hin
if (currentBuild.rawBuild.getCauses().toString().contains('BranchIndexingCause')) {
print "INFO: Build skipped due to trigger being Branch Indexing"
currentBuild.result = 'ABORTED' // optional, gives a better hint to the user that it's been skipped, rather than the default which shows it's successful
return
}
pipeline{
........
虽然代码本身做得很好,并且中止了构建,但我仍然得到了一些建议
[Bitbucket] Notifying pull request build result
[Bitbucket] Build result notified
我想跳过bitbucket notify,因为每当上一次构建成功时,这段代码就会让它看起来像失败了一样,从而造成混乱
如何在Bitbucket中保留显示的最后一个结果
这段代码不是因为放在Jenkins文件中而在运行之前就中止了构建吗我有点困惑。。。是否要启动生成,然后取消它?或者您希望构建根本不启动吗?这将是两种不同的方法。不,代码snipet并没有避免构建到Start我有点困惑。。。是否要启动生成,然后取消它?或者您希望构建根本不启动吗?这将是两种不同的方法。不,代码snipet不会避免构建的开始