Spinnaker Pipeline SpEL Expressions: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 24: Line 24:
=Displaying Pipeline State at Runtime=
=Displaying Pipeline State at Runtime=
=Conditional Expressions=
=Conditional Expressions=
{{External|https://spinnaker.io/docs/reference/pipeline/expressions/#comparisons}}
<syntaxhighlight lang='groovy'>
${ execution.stages.?[ name == 'Rollback Decision' ][0].judgementInput == 'Rollback' }
</syntaxhighlight>

Revision as of 02:30, 24 March 2022

External

Internal

Overview

The Spinnaker pipeline expression language is based on Spring Expression Language (SpEL).

Accessing Pipeline Element State

A Tag set by a Trigger

The tag set by a trigger can be accessed with the following expression:

- image: "something/something-else:${trigger['tag']}"

The Judgement Value set by a Manual Judgement Stage

${ execution.stages.?[ name == '<stage-name>' ][0].judgementInput }

where <stage-name> should be replaced with the actual name of the Manual Judgement stage.

Displaying Pipeline State at Runtime

Conditional Expressions

https://spinnaker.io/docs/reference/pipeline/expressions/#comparisons
 ${ execution.stages.?[ name == 'Rollback Decision' ][0].judgementInput == 'Rollback' }