Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Job DSL Plugin Vs Pipeline Plugin

What is the major difference between Job DSL Plugin and Pipeline Plugin

  1. both provide way to programmatic job creation
  2. which is the best to use as moving ahead and why?
  3. if both have similar functionality, do they have different use cases?
  4. Since Jenkins 2.0 is focusing on Pipelines as code, does this mean that job-dsl does not have a future or Pipeline Plugin is the next step in the Job DSL Plugin?
like image 645
Mr.Pramod Anarase Avatar asked Jun 06 '16 12:06

Mr.Pramod Anarase


People also ask

What is job DSL plugin?

Jenkins job DSL is a plugin that allows us to define jobs in programmatic form with minimal effort. DSL stands for Domain Specific Language. You can describe your jobs in Jenkins using a Groovy Based Language. Groovy-- It's similar to java but simpler because it's much more dynamic. It''s Scripting Language.

What is DSL plugin in Jenkins?

Job DSL was one of the first popular plugins for Jenkins which allows managing configuration as code and many other plugins dealing with this aspect have been created since then, most notably the Jenkins Pipeline and Configuration as Code plugins.

What are the 3 types of pipelines in Jenkins?

Declarative versus Scripted Pipeline syntax Declarative and Scripted Pipelines are constructed fundamentally differently. Declarative Pipeline is a more recent feature of Jenkins Pipeline which: provides richer syntactical features over Scripted Pipeline syntax, and.

What is pipeline plugin?

Jenkins Pipeline is a powerful, first-class feature for managing complex, multi-step pipelines. Jenkins Pipeline, a set of open source plugins and integrations, brings the power of Jenkins and the plugin ecosystem into a scriptable Domain Specific Language (DSL).


1 Answers

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

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:

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

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.

like image 59
Neil Avatar answered Sep 21 '22 12:09

Neil