禁用自动触发构建詹金斯多分支 [英] Disable automatic trigger build jenkins multibranch

查看:127
本文介绍了禁用自动触发构建詹金斯多分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在jenkins中有一个多分支项目,每次按Scan Repository Now时,它都会因为一个新版本而排队

  ‘Jenkinsfile’ found
Met criteria

我想做的是每当我扫描存储库时,它只会将Pull Request添加到项目中而不会触发构建.而且,如果我打开扫描存储库触发器,并且在没有分支索引的情况下不定期运行,则即使它打开了在第一个分支索引上跳过初始构建,它也会构建拉取请求. /p>

我想做的是,只要在pull请求中有一个注释"build",它就会建立分支,因此,如果pr不包含注释,它就不应建立任何东西.

我该如何实现?

这是我的设置

我使用Jenkins 2.180

解决方案

构建策略"的默认设置是或"列表.您需要删除现有的构建策略,并添加所有策略匹配"构建策略,然后向其添加更改请求"和跳过对第一分支索引的初始构建".

来源: https://issues.jenkins-ci.org/browse/JENKINS -58442

I have a multibranch project in jenkins, and every time I press Scan Repository Now it queue a new build just because

  ‘Jenkinsfile’ found
Met criteria

What I'd like to do is whenever I scan the repository, it only add Pull Request to the project without triggering a build. And also, if I turn on scan repository trigger, periodically if not otherwise run, every time it branch indexing, it also build the pull request even after I turn on Skip initial build on first branch indexing.

What I'd like to do is whenever there's a comment 'build' in the pull request, then it builds the branch, so if the pr doesn't contain the comment, it should not build anything.

How can I achieve this?

This is my setup

I use Jenkins 2.180

解决方案

The default for Build Strategies is to OR the list together. You'll need to remove the existing build strategies and add an "All Strategies Match" build strategy and add "Change Requests" and "Skip Initial Build on First Branch Indexing" to that.

Source: https://issues.jenkins-ci.org/browse/JENKINS-58442

这篇关于禁用自动触发构建詹金斯多分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆