如何在Jenkins构建之前自动合并Git分支? [英] How to auto merge Git branches prior to a Jenkins build?

查看:499
本文介绍了如何在Jenkins构建之前自动合并Git分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Jenkins构建之前自动合并Git分支?

How to auto merge Git branches prior to a Jenkins build?

我有2个版本,一个用于分支master,一个用于生产.

I have 2 builds, one for branch master and one for production.

当我进行生产构建时,我想进行Git合并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屋!

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