Spinnaker Pipeline SpEL Expressions: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 17: Line 17:
  - image: "something/something-else:<font color=teal>${trigger['tag']}</font>"
  - image: "something/something-else:<font color=teal>${trigger['tag']}</font>"
</font>
</font>
==The Judgement Value set by a Manual Judgement Stage==
==The Judgment Value set by a Manual Judgment Stage==
{{External|https://spinnaker.io/docs/reference/pipeline/expressions/#judgmentstring}}
<syntaxhighlight lang='groovy'>
<syntaxhighlight lang='groovy'>
${ execution.stages.?[ name == '<stage-name>' ][0].judgementInput }
${#judgment("<stage-name>")}
</syntaxhighlight>
</syntaxhighlight>
where <code><stage-name></code> should be replaced with the actual name of the Manual Judgement stage.
returns the selected judgment value from the specified Manual Judgment stage. <code><stage-name></code> should be replaced with the actual name of the Manual Judgment stage
 
=Displaying Pipeline State at Runtime=
=Displaying Pipeline State at Runtime=
=Conditional Expressions=
=Conditional Expressions=

Revision as of 03:02, 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 Judgment Value set by a Manual Judgment Stage

https://spinnaker.io/docs/reference/pipeline/expressions/#judgmentstring
${#judgment("<stage-name>")}

returns the selected judgment value from the specified Manual Judgment stage. <stage-name> should be replaced with the actual name of the Manual Judgment stage

Displaying Pipeline State at Runtime

Conditional Expressions

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