Jenkins 和多配置(矩阵)作业 [英] Jenkins and multi-configuration (matrix) jobs

查看:34
本文介绍了Jenkins 和多配置(矩阵)作业的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么Jenkins有两种作业,多配置项目和自由式项目项目?我在某处读到,一旦您选择了其中之一,就无法(轻松)转换为另一个.为什么我不总是选择多配置项目以确保未来更改的安全?

Why are there two kinds of jobs for Jenkins, both the multi-configuration project and the free-style project project? I read somewhere that once you choose one of them, you can't convert to the other (easily). Why wouldn't I always pick the multi-configuration project in order to be safe for future changes?

我想为在 Windows 和 Unix(以及其他平台)上构建的项目设置构建.我发现了这个问题),它提出了同样的问题事情,但我真的没有得到答案.为什么我需要三个矩阵项目(而不是三个自由式项目),每个平台一个?为什么我不能将它们全部保存在一个矩阵中,一个轴是平台和(例如)gcc 版本,另一个轴是(我的)软件版本?

I would like to setup a build for a project building both on Windows and Unix (and other platforms as well). I found this question), which asks the same thing, but I don't really get the answer. Why would I need three matrix projects (and not three free-style projects), one for each platform? Why can't I keep them all in one matrix, with platforms AND (for example) gcc version on one axis and (my) software versions on the other?

我还阅读了这篇博文,但是在同一台机器上构建所有内容,只是 Python 版本不同.

I also read this blog post, but that builds everything on the same machine, with just different Python versions.

简而言之:大多数人如何配置针对许多不同平台的多配置项目?

So, in short: how do most people configure a multi-configuration project targeting many different platforms?

推荐答案

两类工作有各自的功能:

The two types of jobs have separate functions:

  • 自由式作业:这些作业允许您在单台计算机或标签(计算机组,例如Windows-XP-32")上构建您的项目.
  • 多配置作业:这些允许您在多台计算机或标签或两者的混合上构建您的项目,例如 Windows-XP、Windows-Vista、Windows-7 和 RedHat - 用于检查多平台(qt 程序?)的兼容性或构建

如果您有一个想要在 Windows 上构建的项目 &Unix,你有两个选择:

If you have a project which you want to build on Windows & Unix, you have two options:

  • 为每个配置创建一个单独的自由式作业,在这种情况下,您必须单独维护每个配置
  • 您有一个多配置作业,并且您选择了 2 个(或更多)标签/计算机/从站 - 1 个用于 Windows,1 个用于 Unix.在这种情况下,您只需为构建维护一项工作
  • Create a separate free-style job for each configuration, in which case you have to maintain each one individually
  • You have one multi-configuration job, and you select 2 (or more) labels/computers/slaves - 1 for Windows and 1 for Unix. In this case, you only have to maintain one job for the build

您可以将 gcc 版本保持在一个轴上,而将软件版本保持在另一个轴上.没有理由你不能.

You can keep the your gcc versions on one axis, and software versions on another. There is no reason you should not be able to.

您链接的问题有道理,但与您的问题没有直接关系:在他的情况下,他有一个多配置工作 A,成功时触发另一份工作B.现在,在多配置作业中,如果其中一个配置失败,则整个作业都会失败(显然,因为您希望项目能够在所有配置上成功构建).

The question that you link has a fair point, but one that does not relate to your question directly: in his case, he had a multi-configuration job A, which - on success - triggered another job B. Now, in a multi-configuration job, if one of the configuration fails, the entire job fails (obviously, since you want your project to build successfully on all your configurations).

恕我直言,为了在多个平台上构建相同的项目,更好的方法是使用多配置风格的工作.

IMHO, for building the same project on multiple platforms, the better way to go is to use a multi-configuration style job.

这篇关于Jenkins 和多配置(矩阵)作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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