使Jenkins使用可变的SVN URL构建多种配置 [英] Make Jenkins build multiple configurations with variable SVN URLs

查看:261
本文介绍了使Jenkins使用可变的SVN URL构建多种配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使我们的构建过程自动化.

I want to automate our build processes.

我们有30多个配置,每个配置都有不同的SVN分支.理想情况下,由于维护工作量和人为错误的风险,我希望避免创建30个单独的Jenkins作业.

We have 30+ configurations, each with a different SVN branch. Ideally, I would want to avoid having to create 30 separate Jenkins jobs, due to maintenance effort and risk of human error.

这是Jenkins中的多配置项目"的设计目标,但不幸的是,Jenkins不支持在SVN URL中使用配置矩阵轴.

This is what "multi-configuration project" in Jenkins was designed for, but unfortunately Jenkins doesn't support using the configuration matrix axis in the SVN URL.

我也不能使用参数化版本进行构建,因为Jenkins不允许在本地结帐路径中使用变量(URL中的变量可以正常工作,但它们始终最终会进入名为${BRANCH}(字面量)的目录.

I also cannot build using parameterized build, because Jenkins will not allow the variables to be used in the local checkout paths (variables in URLs work fine, but they always end up going to a directory called ${BRANCH} (literal).

最终,我希望能够签出https://domain.ext/something/${BRANCH}/并将其保存到/some/path/${BRANCH}.如果这样做可以使我能够利用Jenkin的内置SCM功能(例如轮询),那就更好了.

At the end of the day, I would like to be able to check out https://domain.ext/something/${BRANCH}/ and save it to /some/path/${BRANCH}. Even better if this is done in a way that leaves me able to take advantage of Jenkin's built-in SCM features (e.g. polling).

如何让詹金斯理解我要实现的目标?

How can I make Jenkins understand what I'm trying to achieve?

推荐答案

有两种方法可以按照您希望看到的内容进行操作.您可以将所有分支添加到单个项目中(通过配置中的添加位置"),将它们检出到不同目录中,然后手动"找出更改的内容(或构建所有内容).可以将它与多配置事物集成在一起,而您的配置轴位于不同的检出位置,即,每个配置都可以通过参数获得不同的工作目录.

There's two ways of doing something along the lines of what you want that I can see. You could either add all the branches in a single project (via "add location" in the config), check them out to different directories and figure out "manually" what changed (or build everything). This could be integrated with the multi-configuration thing with your configuration axis being the different checkout locations, i.e. every configuration gets a different working directory through the parameter.

另一种方式是不告诉Jenkins有关存储库的信息,而是手动触发构建(例如,通过SVN commit钩子),并在第一步中检出源代码.同样,可以按照与上述类似的方式,作为一个多配置项目来完成此工作.

The other way would be not to tell Jenkins about the repository, but trigger builds manually (e.g. through an SVN commit hook) and check out the source as the first build step. Again this could be done as a multi-configuration project along similar lines as outlined above.

这篇关于使Jenkins使用可变的SVN URL构建多种配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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