content_image/818773.jpg
## Declarative Pipeline 

Declarative Pipeline is a relatively recent addition to Jenkins Pipeline [19: Version 2.5 of the "Pipeline plugin" introduces support for Declarative Pipeline syntax] which presents a more simplified and opinionated syntax on top of the Pipeline sub-systems. 

All valid Declarative Pipelines must be enclosed within a pipeline  block, for example: 

pipeline { /* insert Declarative Pipeline here */ } 

The basic statements and expressions which are valid in Declarative Pipeline follow the same rules as Groovy’s syntax with the following exceptions: 

• The top-level of the Pipeline must be a block , specifically: pipeline { } 

• No semicolons as statement separators. Each statement has to be on its own line 

• Blocks must only consist of Sections, Directives, Steps, or assignment statements. 

• A property reference statement is treated as no-argument method invocation. So for example, input is treated as input() 

## Sections 

Sections in Declarative Pipeline typically contain one or more Directives or Steps. 

## agent 

The agent  section specifies where the entire Pipeline, or a specific stage, will execute in the Jenkins environment depending on where the agent  section is placed. The section must be defined at the top-level inside the pipeline  block, but stage-level usage is optional. 

<img src='content_image/818773.jpg'>

## Parameters 

In order to support the wide variety of use-cases Pipeline authors may have, the agent  section supports a few different types of parameters. These parameters can be applied at the top-level of the pipeline  block, or within each stage  directive. 

## any 

Execute the Pipeline, or stage, on any available agent. For example: agent any 

