buildkite / agent-stack-k8s

Spin up an autoscaling stack of Buildkite Agents on Kubernetes
MIT License
77 stars 30 forks source link

Set BUILDKITE_HOOKS_PATH by default #258

Closed bpoland closed 5 months ago

bpoland commented 6 months ago

I was having trouble getting hooks to run with k8s agents, then finally realized that although the agent containers have a /buildkite/hooks directory created in them, nothing was pointing the agent at that directory. I was able to get the hooks working by simply setting this env var -- seems like this is something that should be done automatically but let me know if I'm off base!

bpoland commented 6 months ago

Also just a note for anyone that sees this, I was able to get it working in the mean time by adding BUILDKITE_HOOKS_PATH: /buildkite/hooks in the secret referenced by gitEnvFrom alongside the SSH key, since the entire secret gets mounted as env vars for the containers :)

https://github.com/buildkite/agent-stack-k8s/tree/main?tab=readme-ov-file#cloning-repos-via-ssh