Given we have Job DSL as script, yet is jenkins pipeline script superior and recommended?

As I have read many blogs on Jenkins, I think most of the time Jenkins Pipeline script is recommended over freestyle jobs and I agree on it, as any manual UI interaction is difficult and not ideal to automate. But at the same time we can script freestyle jobs in Job DSL and we may have the best of both world. So given Jenkins Pipeline script vs Job DSL, which is more recommended and why?

1 comment

  • 0
    Allan Burdajewicz

    Hello Saurabh,

    Although both solutions share the same space Job DSL and Pipeline serve different purposes.

    A Pipeline is a job implementation. It enables you to define a delivery pipeline as code (via a Groovy DSL). The pipeline script can be retrieved from an SCM. This is the recommend job implementation in Jenkins. 

    Job DSL is a job generator. It enables you to orchestrate a job creation as code (via a Groovy DSL). A Job DSL can generate pipeline jobs.

    One is not preferred to the other, there are often complementary.


Please sign in to leave a comment.