Groovy script defining this Pipeline. A quick example:
node { sh 'echo hello world' }
You can write any Groovy code you need, using Java API calls plus the GDK. You can also call Jenkins APIs and APIs in Jenkins plugins. (If Use Groovy Sandbox is checked, or you are not an administrator, not all APIs will be available.)
There are many special build steps available, like node
and sh
in the example.
Use the Snippet Generator to see them all and see how they should be configured.
Step parameters are given as key-value pairs; if there is just one mandatory parameter the name may be omitted, so
stage 'Build'
is a shortcut for
stage name: 'Build'
but if you specify multiple parameters they must all be named:
stage name: 'Build', concurrency: 1
There are also some predefined variables. Use the Snippet Generator to see them all with usage information.