Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set EnvVar for git submodule mirrors to support volume mounting git mirrors in plugins #2511

Open
tmcg-gusto opened this issue Nov 22, 2023 · 0 comments

Comments

@tmcg-gusto
Copy link

Is your feature request related to a problem? Please describe.
We have a project that uses a git submodule for some external data, and runs its CI steps using the docker-buildkite-plugin. We're using the latest buildkite-agent so git-mirrors are enabled everywhere.

The agent provides the BUILDKITE_REPO_MIRROR env var so that the plugins can volume mount the mirror directory into the containers, but there is no variable provided for any submodules, resulting in errors attempting to do git operations on the submodule inside the CI container.

Describe the solution you'd like
The default checkout phase should set environment variable(s) for all git submodule mirrors used for the checkout so that plugin authors can add mirror volume mounts. I imagine it'd need to look something like BUILDKITE_REPO_SUBMODULE_MIRROR_<x> with x being an integer, similar to how the other plugin variables work for arrays.

Describe alternatives you've considered
If I could disable git-mirrors just for this pipeline I would, since this repo is relatively small (please let me know if I missed an env var that'd do that for me). That'd be a fine solution for us, but having the mirrors mount properly would be preferable long term.

Our current workaround is to hardcode a volume mount for the submodule mirror in our docker plugin config.

Additional context
The operations that are failing in our containers are go builds (with buildvcs enabled, buildvcs=false works around the issue for the build steps) and a golang linter that needs to run go list all which apparently needs the submodule's git dir.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant