简体   繁体   English

强制Jenkins重建MultiBranch Pipeline项目中的所有分支

[英]Force Jenkins to rebuild all branches in MultiBranch Pipeline project

I would like Jenkins to rebuild all existing git repository branches after scheduled branch indexing even if there were no changes since last build but right now I can do that only manually. 我希望Jenkins在计划的分支索引之后重建所有现有的git存储库分支,即使自上次构建以来没有任何更改,但是现在我只能手动执行此操作。

Checking branch MyBranch
Met criteria
No changes detected in MyBranch (still at db2c95ede39116529fec42a5fcdd54f0a2dd93d1)

Is there any way to trigger a scheduled build if it detects no changes? 如果检测到没有更改,有没有办法触发预定的构建?

Jenkins 2.7.4 詹金斯2.7.4

I had the same need - I wanted a clean and a forced build every weekend. 我也有同样的需求 - 我希望每个周末都有一个干净的和强制的构建。 I used the Parameterized Trigger Plugin , created a new job: 我使用参数化触发插件 ,创建了一个新工作:

原始管道和每周重建工作

I scheduled it the way I wanted, and added steps to trigger all the branches in the main job: 我按照我想要的方式安排了它,并添加了触发主要工作中所有分支的步骤:

新作业手动触发主管道上的构建。

It is not very flexible, as you have to modify the builds to trigger each time you add a branch to your pipeline; 它不是很灵活,因为您必须修改构建以在每次向管道添加分支时触发; it also defeats the "CI as code" and zero configuration principle; 它也打败了“CI as code”和零配置原则; but if that's not something you do everyday, and have a procedure your developpers follow when they change something on Jenkins, you can write it down there and be just fine. 但如果那不是你每天都做的事情,并且你的开发人员在詹金斯改变某些东西时会遵循一个程序,你可以把它写在那里并且没问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM