BitBucket + Jenkins:仅当特定分支被更改时触发构建 [英] BitBucket+Jenkins: Trigger build only when specific branch is changed
问题描述
以下是对这个问题的解决方案,尽管它看起来像是一种解决方法,而不是一个确定的解决方案。有没有办法,通过任一工作配置或bitbucket挂钩配置,我可以设置我的工作只有当一个特定的分支被推到一个版本?
发布该问题已经过去了大约一年,我希望有一些插件更新可以在不需要额外工作的情况下进行更新在上面的链接中,或者总是有一种简单的方法,我只是没有看到。
@Ryan Taylor 已经说过你可以使用Bitbucket-Plugin: 通过这种方式,我有三个构建项目,一个用于所有功能,一个用于开发,一个用于发布分支。 The following is a purported solution to the problem, although it does seem like a workaround rather that a definitive solution. Is there a way, through either job config or bitbucket hook config, that I can set my jobs to run a build only when a specific branch is pushed to? Is it possible to trigger Jenkins from one specific branch only? It has been about a year since the posting of that question, I'm hoping there's been some plugin updates to allow for this without the extra work required in the above link, or perhaps there's always been an easy way that I'm just not seeing. As @Ryan Taylor already said you can use the Bitbucket-Plugin:
最好的是,您不必为新的Jenkins项目添加新的钩子。
https://YOUR.JENKINS.SERVER:PORT/bitbucket-hook
- Configure your Jenkins project as follows:
- under build trigger enable Build when a change is pushed to BitBucket
- under Source Code Management select GIT; enter your credentials and define Branches to build (like **feature/*)
By this way I have three build projects, one for all features, one for develop and one for release branch.
And best of it, you don't have to ad new hooks for new Jenkins projects.
这篇关于BitBucket + Jenkins:仅当特定分支被更改时触发构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!