shell-operator icon indicating copy to clipboard operation
shell-operator copied to clipboard

SHELL_OPERATOR_HOOKS_DIR not set when running outside of cluster

Open rspurgeon opened this issue 5 years ago • 2 comments

Following instructions here to debug a hook: https://github.com/flant/shell-operator/blob/master/RUNNING.md

And looking at example using functions like this one: https://github.com/flant/shell-operator/blob/master/examples/003-common-library/hooks/hook.sh

I shouldn't be able to run this example outside of a cluster because of the hardcoded path to the library bash script. I tried adding $SHELL_OPERATOR_HOOKS_DIR into the path but it's empth at runtime when running outside the cluster.

Attempting to source from scripts in this directory returns errcode 127 (command not found?). Verified the empty value by echo'ing the variable in the Hook Run task.

rspurgeon avatar Aug 18 '20 13:08 rspurgeon

I see, it is not clear in the documentation. There is no passing default hook dir as an environment variable to hooks. You need to set SHELL_OPERATOR_HOOKS_DIR at shell-operator start and then this environment variable should be passed to hooks. Please, report if this is not happening.

diafour avatar Aug 24 '20 12:08 diafour

I think we can close it as a stalled issue. @diafour have you fixed the relevant documentation?

shurup avatar Jan 15 '21 04:01 shurup