仅在特定分支发生更改时才触发Jenkins Job

编程入门 行业动态 更新时间:2024-10-28 16:16:50
本文介绍了仅在特定分支发生更改时才触发Jenkins Job的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经配置了jenkins作业,希望当我对该特定分支的Github进行一些更改时,应该触发该作业.

I have configured a jenkins job and I wish it should be triggered when I make some changes to the Github for that particular branch.

我使用Github插件并启用了将更改推送到github时构建". 但是,如果其他人创建了一个单独的分支并将其推送到该分支,则此选项将触发我的工作.

I use the Github plugin and has enabled "build when a change is pushed to github". But this option is triggering my Job if someone else create a separate branch and push to that branch.

下面让我解释一下:

Change pushed to branch "release" Jenkins notified and job executes - Expected behavior Another change is now pushed to branch "xyz" but I don't intend this to cause execution of my Jenkins job. The Job "xyz" is created out of the same repo though.

如何防止推送到其他分支的更改触发我的工作?

How can I prevent changes pushed to other branches triggering my job?

启用将更改推送到github时构建"是不正确的吗?

Is enabling "build when a change is pushed to github" is not correct?

推荐答案

在作业配置的git部分中,有一个字段"Branches to build".您可以在此处指定将新的提交推送到它们时哪些分支将触发构建.

In the git section of the job configuration is a field 'Branches to build'. You can specify here which branches will trigger a build when new commits are pushed to them.

例如对于我的一项工作,我拥有**/BARE- *,因此只有以BARE-开头的分支才会触发构建.

e.g. for one of my jobs I have **/BARE-* , so only branches which start with BARE- will trigger a build.

更多推荐

仅在特定分支发生更改时才触发Jenkins Job

本文发布于:2023-10-26 11:14:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1529969.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:时才   分支   发生   在特定   Job

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!