custom
operation
A custom command to be executed as a step.
info
Any of the commands executed will be passed to bash
for execution.
Parameters
The following parameters can be used:
Parameter | Type | Description |
---|---|---|
name | string | the name of the step to be shown when omni up or omni down are being run |
meet | multiline string | the command to run to meet the requirement during set up |
met? | multiline string | the command to run to know if we are currently meeting the requirement |
unmeet | multiline string | the command to run to 'unmeet' the requirement during tear down |
dir | path | Relative path to the directory the custom operation needs to be run from. The dynamic environment of that directory will be loaded before any of the executions for the operation. Defaults to the work dir root. |
Examples
up:
# Simple command for which the meet operation will be run
# each time `omni up` is called
- custom:
name: Printing hello
meet: echo "hello"
# Now we say goodbye during `omni down`, but we don't do
# anything during `omni up`
- custom:
name: Saying goodbye
unmeet: echo "goodbye"
# Let's say both
- custom:
name: Greetings
meet: echo "hello"
unmeet: echo "goodbye"
# But now we wanna say hello only if we haven't said it yet
# and we wanna say goodbye only if we said hello before
- custom:
name: Proper greetings
met?: test -f /tmp/did_greet
meet: touch /tmp/did_greet && echo "hello"
unmeet: rm /tmp/did_greet && echo "goodbye"