Table of Contents

Jenkins - JenkinsFile

About

Syntax

Scripted Pipeline is written in a limited form of Groovy syntax.

[1, 2, 3] is a list in Groovy whereas [a: 1, b: 2, c: 3] is a map.

The built-in documentation can be found globally at: http://localhost:8080/pipeline-syntax/

node {
    sh 'echo hello world'
}

where:

Step parameters

Step parameters are given as key-value pairs:

# Step parameters are given as key-value pairs
readFile file: 'build.properties'
# Shortcut when only one parameter is mandatory
# if parameter is a map, it must be enclosed in parentheses to avoid a syntactic ambiguity.
readFile 'build.properties'
# multiple parameters:
readFile file: 'build.properties', encoding: 'ISO-8859-1'
# nested steps
splitTests parallelism: count(size: 3)

Built-in variable

See http://localhost:8080/pipeline-syntax/globals