Conditional execution
TLDR;
Opctl supports using if statements and predicates to make parts of your op run conditionally.
Example
- Start this op:
name: conditionalExecution
inputs:
shouldRunContainer:
description: whether to run the container or not
boolean: {}
run:
if:
- eq: [true, $(shouldRunContainer)]
container:
cmd: [echo, 'hello!']
image: { ref: alpine } - When prompted, enter
true
orfalse
- Observe you only see the container run and
hello!
logged when you entertrue
.