Skip to content

Repo hooks are executed outside k8s job #31

@keith

Description

@keith

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

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?

args: ['bootstrap', '--experiment=git-mirrors', '--git-mirrors-path=/git-mirrors', '--ssh-keyscan', '--command', 'true'],

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions