作业DSL插件与管道插件 [英] Job DSL Plugin Vs Pipeline Plugin

查看:163
本文介绍了作业DSL插件与管道插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  1. 两者均提供了以编程方式创造就业机会的方式
  2. 前进时最适合使用哪个,为什么?
  3. 如果两者都具有相似的功能,那么它们是否具有不同的用例?
  4. 既然Jenkins 2.0专注于将流水线作为代码,这是否意味着job-dsl没有未来,或者流水线插件是Job DSL插件的下一步?

推荐答案

我在这两个方面都有丰富的经验.一个简洁的回答是,Job DSL已经存在了很长时间,并且是Netflix的编码" Jenkins的开源解决方案.它允许您在编写Jenkins作业的脚本中引入逻辑和变量,并且通常可以使用这些作业为特定项目形成某种管道".该插件作为启用工作模板和脚本编写的一种常用方法而受到了广泛的关注.

I have extensive experience with both. A concise reply is that Job DSL has existed for much longer and was Netflix's open source solution for "coding" Jenkins. It allowed you to introduce logic and variables into scripting your Jenkins jobs and typically one would use these jobs to form some sort of "pipeline" for a particular project. This plugin received quite a bit of traction as a common way to enable job templating and scripting.

Jenkins管道(2.0)是Jenkins作业的一种新形式,它完全基于DSL,并试图消除将多个作业缝合在一起以填充单个管道的需要,这是迄今为止Job DSL的最常用用法.最初,由于Pipeline DSL不提供Job DSL所具有的许多功能,并且如上所述,Job DSL允许您创建Pipeline作业,因此可以将它们一起使用以定义管道.

Jenkins Pipeline (2.0) is a new incarnation of a Jenkins job that is entirely based on a DSL and attempts to eliminate the need to stitch together multiple jobs to fill a single pipeline which was by far the most common use of Job DSL. Originally, with Pipeline DSL not offering many of the features that Job DSL did, and as mentioned above Job DSL would allow you to create Pipeline jobs, they could be used together to define a pipeline.

如今,IMO没有理由使用Job DSL,因为Pipeline是Jenkins支持的Jenkins管道脚本编写机制,并且已经达到或超越了Job DSL的许多功能.新的插件正在本地为Pipeline开发,而Jenkins开发人员不鼓励那些新插件与Pipeline集成.管道具有以下优点:

Today, IMO there is little reason to use Job DSL because Pipeline is the Jenkins-supported mechanism for scripting Jenkins pipelines and it has met or surpassed much of the functionality of Job DSL. New plugins are being developed natively for Pipeline, and those that don't are being encouraged by Jenkins developers to integrate with Pipeline. And Pipeline has several advantages:

  • 与Job一样,无需使用管道播种"作业 DSL是因为管道是工作本身.有了Job DSL, 只是创建其他作业的脚本.
  • 使用管道,您可以使用诸如参数化手动输入步骤之类的功能,从而可以在管道内指定逻辑中途
  • 可以是的逻辑 作业DSL中包含的内容仅限于创建作业 他们自己;而使用Pipeline,您可以直接包含逻辑 在工作中.
  • 使用例如创建基本的传送管道要困难得多.建立管道插件;使用Pipeline,您的文件会更小,语法也会更短.而且,如果您正在使用Job DSL创建Pipeline作业,那么Jenkins Pipeline提供了现成的模板功能,我再也没有看到它的主要价值了.
  • There is no need to "seed" jobs using Pipeline as there is with Job DSL since the Pipeline is the job itself. With Job DSL, it's just a script that creates other jobs.
  • With Pipeline, you have features such as a parameterized manual input step, allowing you specify logic midstream within the pipeline
  • The logic that can be included in a Job DSL is limited to creating the jobs themselves; whereas with Pipeline you can include logic directly inside the job.
  • Job DSL is simply much more difficult to create a basic delivery pipeline using, for example, the Build Pipeline Plugin; using Pipeline your file will be smaller and syntax shorter. And if you're using Job DSL to create Pipeline jobs, I haven't seen a major value for that anymore given the templating features available out-of-the-box with Jenkins Pipeline.

最后,Jenkins Pipeline是迄今为止Jenkins最流行的功能.查看 Jenkins World 2016议程,您会看到大约. 50%的会话涉及管道.对于Job DSL没有.

Finally, Jenkins Pipeline is by far the most prevalent feature of Jenkins right now. Check out the Jenkins World 2016 agenda and you'll see approx. 50% of the sessions involve pipeline. None for Job DSL.

这篇关于作业DSL插件与管道插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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