Skip to content

Commit

Permalink
[JENKINS-41239] Add doc for new cleanup post condition.
Browse files Browse the repository at this point in the history
This was just released in Declarative 1.2.9 so this should be ready to
go whenever works for you.
  • Loading branch information
abayer committed Apr 17, 2018
1 parent 718cc95 commit c8c7bce
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions content/doc/book/pipeline/syntax.adoc
Expand Up @@ -258,10 +258,11 @@ The `post` section defines one or more additional <<declarative-steps,steps>>
that are run upon the completion of a Pipeline's or stage's run (depending on
the location of the `post` section within the Pipeline). `post` can support any of
of the following <<post-conditions, post-condition>> blocks: `always`,
`changed`, `fixed`, `regression`, `aborted`, `failure`, `success`, and `unstable`.
These condition blocks allow the execution of steps inside each condition
depending on the completion status of the Pipeline or stage.
The condition blocks are executed in the order shown below.
`changed`, `fixed`, `regression`, `aborted`, `failure`, `success`,
`unstable`, and `cleanup`. These condition blocks allow the execution
of steps inside each condition depending on the completion status of
the Pipeline or stage. The condition blocks are executed in the order
shown below.

[cols="^10h,>90a",role=syntax]
|===
Expand Down Expand Up @@ -297,6 +298,9 @@ run has a "success" status, typically denoted by blue or green in the web UI.
`unstable`:: Only run the steps in `post` if the current Pipeline's or stage's
run has an "unstable" status, usually caused by test failures, code violations,
etc. This is typically denoted by yellow in the web UI.
`cleanup`:: Run the steps in this `post` condition after every other
`post` condition has been evaluated, regardless of the Pipeline or
stage's status.

[[post-example]]
===== Example
Expand Down

2 comments on commit c8c7bce

@monupawan
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I know which version of Jenkins supports the cleanup method?, As we are using Jenkins 2.89 and it seems it doesn't have cleanup method in post.

@bitwiseman
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@monupawan You'll need to update your declarative pipeline plugin.

Please sign in to comment.