buildkite-builder
buildkite-builder copied to clipboard
Figure out how to not install Git in Docker image
Currently, we're installing git to make buildkite-agent pipeline upload not print out a warning during the pipeline upload step. The agent CLI tries to fetch the commit SHA to set an environment variable (I'm not sure why).
Asked @JuanitoFatas
In rolling out Buildkite Builder, I noticed that the
buildkite-agent pipeline uploadcommand usesgitto find the commit SHA so that it can set an environment variable. Ifgitdoesn’t exist,, then the upload operation still works but prints a warning. Some questions I had:
- Why does it need find the commit sha for the upload operation?
- Can I pass it in so that it doesn’t use
git? I’m trying to not have to installgitin our docker image.
Response:
Hi Ngan, Buildkite Builder is cool. Thanks for your question!
- A build could be created by HEAD / FETCH_HEAD, then we need to resolve HEAD as commit sha https://github.com/buildkite/agent/pull/871
- I am not sure and I will ask around. But I think agent assumes Git exists, so there are many places that use Git in the agent codebase.
I will let you know if I get more information about 2. Thanks!