简体   繁体   English

从Jenkins Multijob迁移到Pipeline插件

[英]Migrate from Jenkins Multijob to Pipeline plug-in

Currently we are using Jenkins CI 1.643 (I believe) with the Multijob plugin and Job DSL. 目前我们正在使用Jenkins CI 1.643(我相信)使用Multijob插件和Job DSL。
A collection of jobs is generated using Job DSL, as well as a multijob that contains all the other jobs in a specific order (build, analysis, unit test, integration test, etc.). 使用Job DSL生成作业集合,以及包含特定顺序中的所有其他作业的多工作(构建,分析,单元测试,集成测试等)。

I'm interested in upgrading to Jenkins 2 and using the Pipeline plug-in (previously known as the Workflow plug-in). 我有兴趣升级到Jenkins 2并使用Pipeline插件(以前称为Workflow插件)。 The Pipeline plug-in offers a nice graphical representation and also offers some more advanced features that we currently do not have (like the "pause" action, that requires human interaction). Pipeline插件提供了一个很好的图形表示,还提供了一些我们目前没有的更高级功能(例如需要人工交互的“暂停”操作)。 The Blue Ocean project also seems to be very sleek, but requires the Pipeline plug-in. Blue Ocean项目似乎也非常时尚,但需要Pipeline插件。

Regarding the migration, I have a few questions: 关于迁移,我有几个问题:

  • Should I keep using Job DSL? 我应该继续使用Job DSL吗? We have a really nice templating mechanism created in Groovy so we only have to enter a few details about the product (like the compiler being used and certain quality thresholds). 我们在Groovy中创建了一个非常好的模板机制,所以我们只需要输入一些关于产品的细节(比如正在使用的编译器和某些质量阈值)。 I think I would like to keep this. 我想我想保留这个。
  • Is there a guide to "migrate" from the Multijob plug-in to the Pipeline plug-in? 是否有从Multijob插件“迁移”到Pipeline插件的指南?
  • What are the things I should keep in mind? 我应该记住哪些事情? (key differences between the plug-ins.) (插件之间的主要区别。)

Not a complete answer, but: 不是一个完整的答案,但是:

We have a really nice templating mechanism created in Groovy so we only have to enter a few details about the product (like the compiler being used and certain quality thresholds). 我们在Groovy中创建了一个非常好的模板机制,所以我们只需要输入一些关于产品的细节(比如正在使用的编译器和某些质量阈值)。 I think I would like to keep this. 我想我想保留这个。

The equivalent in Pipeline would be to create a Groovy library abstracting the common aspects of your projects, and call it from short main scripts in various jobs that just pass different arguments. Pipeline中的等价物是创建一个抽象项目的常见方面的Groovy库,并在只传递不同参数的各种作业中从短主脚本调用它。

Should I keep using Job DSL? 我应该继续使用Job DSL吗?

There are still reasons to use Job DSL with Pipeline in certain cases: for example, if you want to automatically generate an array of jobs based on some computed criteria. 在某些情况下,仍然有理由使用带有管道的Job DSL:例如,如果要根据某些计算标准自动生成作业数组。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM