A basic Pipeline can be created in either of the following ways:
-
By entering a script directly in the Jenkins web UI.
-
By creating a
Jenkinsfilewhich can be checked into a project’s source control repository.
The syntax for defining a Pipeline with either approach is the same, but while Jenkins supports entering Pipeline directly into the web UI, it’s generally considered best practice to define the Pipeline in a Jenkinsfile which Jenkins will then load directly from source control. [1]
The Jenkins project maintains a Pipeline Syntax Reference which may useful to refer to when creating a Jenkinsfile.