Lifecycle Hooks
Components can define lifecycle hooks:
pre_applypost_applypre_destroypost_destroy
components: api: type: script runner: local hooks: post_apply: - command: test -n "$API_URL" env: API_URL: "${api.outputs.url}"Hooks require a runner with Exec.
Hooks default to:
shell: ["sh", "-c"]The command is passed as the script argument to the shell. This is different from script components, where the shell is the executable used to run a source file.
Environment
Section titled “Environment”Hook env values can use Orch interpolation. Hook commands can interpolate explicit inputs and component outputs, but normal $ENV_VAR expansion is left to the shell on the runner.
Orch also sets component runtime variables during hook execution:
ORCH_ENV_IDORCH_COMPONENT_NAMEORCH_COMPONENT_TYPEORCH_RUNNER_NAMEORCH_WORKDIRORCH_LIFECYCLE