Jenkins: Scripted vs Declarative pipelines

#jenkins #pipelines

Many people ask this question:

Should I use Jenkins Declarative Pipeline syntax, or should I use the scripted one?

And what is the difference between the two?


TL:DR

Both variants use Groovy DSL

Scripted Pipeline:

  • The scripted pipeline was the first implementation of the "pipeline as a code" standard in the Jenkins ecosystem.

Scripted Pipeline


Declarative Pipeline:

  • The declarative pipeline represents newer attempt to this standard implementation introducing more opinionated syntax and adding several interesting features you can't find in the scripted pipeline syntax.

Declarative Pipeline

Which one to choose ?

Instead of giving an answer "It Totally Depends " , I personally would recommend to use Declarative because of following advantages:

  1. Pipeline code Validation.
  2. Restart form any stage.
  3. Skip stage
  4. Declarative pipeline: Options
  5. Built in Checkout SCM step.

Feel free to comment if you noticed any other ! Hope you liked the page. Cheers ! Happy New year



要查看或添加评论,请登录

Rajakumar Muthukumarasamy的更多文章

  • Kubernetes: Deployment vs StatefulSet

    Kubernetes: Deployment vs StatefulSet

    TL:DR Key Differences: Deployment 1. Used to deploy stateless applications 2.

  • Is Pair Programming really helpful?

    Is Pair Programming really helpful?

    Of course , Pair Programming, as the name suggests, is a software development practice in which two programmers…

社区洞察

其他会员也浏览了