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

git-mirrors: set BUILDKITE_REPO_MIRROR=/path/to/mirror/repo #1311

Merged
merged 1 commit into from
Sep 29, 2020

Conversation

pda
Copy link
Member

@pda pda commented Sep 28, 2020

When git-mirrors (currently an experiment) is enabled, export a BUILDKITE_REPO_MIRROR=/path/to/mirror/repo environment variable. This makes it easy to mount the mirror as a volume in docker containers, so that git within the container can access the git reference repository data.

The name BUILDKITE_REPO_MIRROR was chosen to reflect the existing BUILDKITE_REPO environment variable.

This environment variable enables transparent support for git-mirrors in our docker plugin and our docker-compose plugin:

@pda
Copy link
Member Author

pda commented Sep 28, 2020

Here's a before (current agent master branch) and after (this PR) running a build that does a git log using docker#0c53b57a02e35024b8f55c5bdfab3b4453ef63e3 plugin from buildkite-plugins/docker-buildkite-plugin#167

image

… seems good.

Here's the pipeline I tested:

env:
  GREETING: hello world

steps:
  - command: "git --no-pager log"
    plugins:
      - docker#0c53b57a02e35024b8f55c5bdfab3b4453ef63e3:
          image: "golang:1.15"
    retry:
      manual:
        permit_on_passed: true

@pda pda requested a review from matthewd September 29, 2020 01:31
Copy link

@jayco jayco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks legit! 👌

@pda pda merged commit 4de7c86 into master Sep 29, 2020
@pda pda deleted the git-mirrors-env-var branch September 29, 2020 03:32
@chrislloyd
Copy link
Contributor

Thank you! Literally just ran into this issue.

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

Successfully merging this pull request may close these issues.

3 participants