Closed c2h5oh closed 6 months ago
Hi @c2h5oh, for disabling checkout, would setting BUILDKITE_REPO=""
be possible for you?
Sure. Where would I be doing that? in step env?
Currently, changing BUILDKITE_REPO
must be done using either an environment or pre-checkout agent hook. The pipeline's configured repo would override attempts to set it with e.g. step env.
Wouldn't that disable checkout for all steps?
I agree that this is probably not ideal, but since hooks are executed in each step, you could conceivably vary BUILDKITE_REPO
based on some other variable set in the step env:
#!/usr/bin/env bash
if [[ "${SKIP_CHECKOUT:false}" == "true" ]]; then
export BUILDKITE_REPO=""
fi
Well, since we agree this is not ideal would you accept a PR that would add checkout control to this plugin, or do you consider it out of scope?
I was trying to figure out the best place to add these controls, since it might be a more general agent issue. We've discussed it and I think we agree there ought to be better control over checkout specifically for the k8s stack. We're happy for, say, a checkout
section in the kubernetes
plugin definition, but we don't have a firm idea of what that looks like yet. If you're willing to make a PR exploring this, please do!
I was thinking about combining features present in plugins normally used to implement this.
checkout:
disableCheckout: false
cloneFlags: ""
fetchFlags: ""
disableCheckout
to true would replace checkout hook with NOP, like this plugin does https://github.com/uber-workflow/run-without-clone-buildkite-plugin/blob/master/hooks/checkoutBUILDKITE_GIT_CLONE_FLAGS
, BUILDKITE_GIT_FETCH_FLAGS
in pre-checkout like this plugin https://github.com/Hivebrite/git-flags-buildkite-plugin/blob/main/hooks/pre-checkout👋 hey there, was having trouble getting hooks to work at all but I figured it out -- not sure if any of you had the same issue?
BUILDKITE_GIT_CLONE_FLAGS
,BUILDKITE_GIT_FETCH_FLAGS
) - you'd normally do it using a plugin but since this plugins also does checkout you can't