O'Reilly logo

Continuous Integration, Delivery, and Deployment by Sander Rossel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Scripted pipeline syntax

The scripted pipeline syntax is probably a little easier to grasp. It is just code like you are used to. As such, it does not really need a lot of explanation. The previous example can be rewritten in regular scripted syntax:

def greetings = 'Hello' stage('Greet') {    echo greetings}

Groovy is an optionally typed language, so you may be more comfortable with the following alternative:

String greetings = 'Hello' [...]

That is A LOT shorter than the same code in declarative style. As you can see, we still use the stage('Greet') { ... } block, but we do not wrap it in a stages { ... } block and it does not contain a steps { ... } block. In fact, stages and steps are not even allowed in this context. Jenkins will not recognize ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required