-
Notifications
You must be signed in to change notification settings - Fork 17
Description
When using buildkite's repo hooks as described here https://buildkite.com/docs/agent/v3/hooks#available-hooks if you have a post-checkout or pre-command hook, they are run outside of the k8s job that actually ends up running your code. This fails in a few ways for us since we use those to do some setup that depends on tools that are in our custom docker image, and to export environment variables we expect to exist later.
I believe this is because the core command is not run by buildkite-agent but instead is run directly
k8s-buildkite-plugin/lib/job.jsonnet
Lines 285 to 286 in 5826cbd
| command: ['/bin/sh', '-c'], | |
| args: [env.BUILDKITE_COMMAND], |
I'm sure there was a good reason but I wonder if we could somehow run this with the buildkite-agent bootstrap command, which I assume would fix the issue?
k8s-buildkite-plugin/lib/job.jsonnet
Line 321 in 5826cbd
| args: ['bootstrap', '--experiment=git-mirrors', '--git-mirrors-path=/git-mirrors', '--ssh-keyscan', '--command', 'true'], |