You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we have multiple metahook instances, let's not generate multiple temporary directories; instead just create one (and only dump the environment variables once). We also shard the vars file by the plugin configuration (calculating a hash using the standard cksum utility) so that you can have multiple metahook instances each with their own configuration (which is implicitly stored in the vars file).
I'm not sure why the vars file is created at all, as it seems it could be dynamically probed with [[ -v "BUILDKITE_PLUGIN_METAHOOK_${upperd}" ]] instead of using the grep on the vars file (since the variables should be live in the environment when the hook is actually executed), but I kept the current behavior.
Verification
This fixed an issue with multiple metahook instances in a pipeline of mine.
Changes
If we have multiple
metahook
instances, let's not generate multiple temporary directories; instead just create one (and only dump the environment variables once). We also shard thevars
file by the plugin configuration (calculating a hash using the standardcksum
utility) so that you can have multiplemetahook
instances each with their own configuration (which is implicitly stored in thevars
file).I'm not sure why the
vars
file is created at all, as it seems it could be dynamically probed with[[ -v "BUILDKITE_PLUGIN_METAHOOK_${upperd}" ]]
instead of using thegrep
on thevars
file (since the variables should be live in the environment when the hook is actually executed), but I kept the current behavior.Verification
This fixed an issue with multiple
metahook
instances in a pipeline of mine.Originally posted by @staticfloat in improbable-eng/metahook-buildkite-plugin#12
The text was updated successfully, but these errors were encountered: