The Declarative pipeline should start with the mandatory pipeline block.
Agent signifies where the Jenkins build job should run. In this case, we have selected agent as any
– stages block consists of different executable stage blocks. – At least one stage block is mandatory inside stages block.
Steps blocks consists of the actual operation which needs to be performed inside jenkins.
- In the script session we can define scripted pipeline codes. - In many use-cases, the script step is unnecessary in Declarative Pipelines, but it can provide a useful “escape hatch.”