buildkite-builder icon indicating copy to clipboard operation
buildkite-builder copied to clipboard

Figure out how to not install Git in Docker image

Open ngan opened this issue 5 years ago • 1 comments

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).

ngan avatar Dec 02 '20 17:12 ngan

Asked @JuanitoFatas

In rolling out Buildkite Builder, I noticed that the buildkite-agent pipeline upload command uses git to find the commit SHA so that it can set an environment variable. If git doesn’t exist,, then the upload operation still works but prints a warning. Some questions I had:

  1. Why does it need find the commit sha for the upload operation?
  2. Can I pass it in so that it doesn’t use git? I’m trying to not have to install git in our docker image.

Response:

Hi Ngan, Buildkite Builder is cool. Thanks for your question!

  1. 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
  2. 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!

ngan avatar Dec 05 '20 00:12 ngan