如何在jenkins构建之前自动合并git分支 [英] How to auto merge git branches prior to a jenkins build
问题描述
如何在jenkins构建之前自动合并git分支 我有2个版本,分别用于分支母版和生产
How to auto merge git branches prior to a jenkins build I have 2 builds, for branch master and production
在进行生产构建时,我想进行git merge origin/master.
I would like to do git merge origin/master when I do the production build.
推荐答案
Jenkins上最新的Git插件对此提供了支持.只需在Job配置中将Git的高级设置下的结帐/合并到本地分支"设置为生产"即可.然后将要构建的分支"设置为"master",或者将其保留为空白,以让Jenkins尝试合并并构建它发现的其他分支并投入生产.它将为每个分支进行一次合并/构建.它还可以将合并的分支推回其提取源.
That's supported by the latest Git Plugin on Jenkins. Just set "Checkout/merge to local branch" to "production" under the Advanced settings for Git in the Job configuration. Then set the "Branches to build" to master, or just leave it blank to have Jenkins try and merge and build each other branch it finds to production. It will do one merge/build for each branch. It can also push the merged branch back to the source it pulled from.
检查一下: https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin# GitPlugin-AdvancedFeatures
这篇关于如何在jenkins构建之前自动合并git分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!