...
Code Block | ||
---|---|---|
| ||
vars: name: "Sabrina" age: 24 pipeline: - if: true: ${vars.name != ''} - if: true: ${vars.age > 21} - log: message: "${vars.name} may have a drink..." - if.else: - log: message: "${vars.name} is too young to have a drink..." - if.end - if.end |
...
Foreach (Iterator)
Looping over a set of data is also called "iterating" over this set of data. Or in other words, "for each" item from the data set, do some action.
...
Sometimes it is necessary to pause the execution flow of a pipeline for a certain amount of time. You can do so using the command wait
.
Example:
Code Block | ||
---|---|---|
| ||
pipeline: - log: message: "Lets wait 2 seconds..." - wait: ms: 2000 - log: message: "2 seconds later." |
...
This example will end the pipeline execution since it expects the condition to be true
, but it is wrong:
Code Block | ||
---|---|---|
| ||
pipeline: - assert: true: "#${1 > 2}" message: "1 is not greater than 2!" |
...