Noting changes introduced in [JENKINS-37792], [JENKINS-37781] and [JENKINS-37778]
Also fixed the script example and marked the code sections as groovy
so that GitHub hopefully can color the code a bit more nicely.
@@ -72,15 +80,17 @@ to-be-released block-scoped `stage` syntax in base Pipeline.
**Required*: At least one is required.
**Parameters*: A single `String`, the name for the `stage`.
**Takes a Closure*: Yes
**Closure Contents*: A `steps` block containing one or more Pipeline steps, including block-scoped steps and the
special `script` block described below, and optionally, certain configuration sections that allow being set on a
per-stage basis.
**NOTE*: Currently only the `agent` section can be configured per-stage.
**NOTE*: Only the "declarative subset" of Groovy is allowed by default. See below for details on that subset.
**NOTE*: The `parallel` step is a special case - it can only be used if it's the sole step in the `stage`.
**Closure Contents*:
* A `steps` block containing one or more Pipeline steps, including block-scoped steps and the special `script` block described below, and optionally, certain configuration sections that allow being set on a per-stage basis.
**NOTE*: Only the "declarative subset" of Groovy is allowed by default. See below for details on that subset.
**NOTE*: The `parallel` step is a special case - it can only be used if it's the sole step in the `stage`.
* An `agent` section can be configured per-stage, see above.
* An optional `when` block specifying if the stage should run or not.
It can contain arbitrary Groovy code, but needs to return `true` if the stage should run or `false` if not.
* An optional `post` block that runs after the steps in the stage. See `postBuild` and `notifications` below.