如何使用Jenkins在主服务器上构建多个版本的分支? [英] How to use Jenkins to build multiple version of branches on master server?

查看:2742
本文介绍了如何使用Jenkins在主服务器上构建多个版本的分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Jenkins CI自动构建我的项目版本2.9。现在我也要建2.10。如何在Jenkins上设置2.10?因为存储库将是相同的2.9建立失败。

I am using Jenkins CI for automatic builds of my project version 2.9. Now I have to build 2.10 also. How do I setup 2.10 on Jenkins? Because the repository will be the same for 2.9 the build failed.

如何处理这个问题?

推荐答案

易于使用复制现有作业选项,但单独的构建配置类似的构建将最终驱使你疯狂。让我们想象你需要调整一个配置一点。

It is so easy to use "Copy existing job" option, but separate build configurations for similar builds will drive you crazy eventually. Let's imagine you need to tweak a configuration a little bit. Will it be OK for you to do it for 2 jobs, 5 jobs, 10?

正确的解决方案

如果您想要具有类似配置的多个单独的作业 - 创建模板作业。 模板工作流程插件会为您执行相关操作。它允许创建具有一些参数的模板,并在其顶部生成多个作业,指定某些值。模板更改将影响所有下级作业。

If you want to have several separate jobs with similar configuration -- create a template job. Template Workflows Plugin will do the trick for you. It allows to create a template with some parameters and generate several jobs on the top of it, specifying certain values. Template changes will affect all subordinate jobs.

模板参数示例

具体的作业创建

与开发相同的规则:不要使用 COPY& PASTE

Same rule as for development: do not use COPY&PASTE

这篇关于如何使用Jenkins在主服务器上构建多个版本的分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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