Migrate from Jenkins Multijob to Pipeline plug-in

与世无争的帅哥 提交于 2019-12-10 13:37:36

问题


Currently we are using Jenkins CI 1.643 (I believe) with the Multijob plugin and 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.).

I'm interested in upgrading to Jenkins 2 and using the Pipeline plug-in (previously known as the Workflow plug-in). 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). The Blue Ocean project also seems to be very sleek, but requires the Pipeline plug-in.

Regarding the migration, I have a few questions:

  • Should I keep using 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). I think I would like to keep this.
  • Is there a guide to "migrate" from the Multijob plug-in to the Pipeline plug-in?
  • What are the things I should keep in mind? (key differences between the plug-ins.)

回答1:


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). 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.

Should I keep using 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.



来源:https://stackoverflow.com/questions/37744355/migrate-from-jenkins-multijob-to-pipeline-plug-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!