diff --git a/build.env b/build.env index 76fb5c91879..5bbc769419a 100755 --- a/build.env +++ b/build.env @@ -44,3 +44,8 @@ ln -sf "$PWD/misc/git/pre-commit" .git/hooks/pre-commit ln -sf "$PWD/misc/git/commit-msg" .git/hooks/commit-msg git config core.hooksPath .git/hooks export EXTRA_BIN=$PWD/test/bin + +# support private github.com/slackhq/vitess-addons repo +if [[ -n "${GH_ACCESS_TOKEN}" ]]; then + git config --global url.https://${GH_ACCESS_TOKEN}@github.com/.insteadOf https://github.com/ +fi diff --git a/docker/base/Dockerfile.mariadb b/docker/base/Dockerfile.mariadb index 95c93f0c27e..7ab85a173bc 100644 --- a/docker/base/Dockerfile.mariadb +++ b/docker/base/Dockerfile.mariadb @@ -16,16 +16,13 @@ ARG BUILD_GIT_BRANCH ARG BUILD_GIT_REV # Allows private repo go dependencies +ARG GOPRIVATE ARG GH_ACCESS_TOKEN # Re-copy sources from working tree USER root COPY . /vt/src/vitess.io/vitess -# Allow checkout of github.com/slackhq/vitess-addons (private repo) -ENV GOPRIVATE=github.com/slackhq/vitess-addons -RUN git config --global url.https://$GH_ACCESS_TOKEN@github.com/.insteadOf https://github.com/ - # Build Vitess RUN make build diff --git a/docker/base/Dockerfile.mariadb103 b/docker/base/Dockerfile.mariadb103 index 804bd739a96..24978c0c5d9 100644 --- a/docker/base/Dockerfile.mariadb103 +++ b/docker/base/Dockerfile.mariadb103 @@ -16,16 +16,13 @@ ARG BUILD_GIT_BRANCH ARG BUILD_GIT_REV # Allows private repo go dependencies +ARG GOPRIVATE ARG GH_ACCESS_TOKEN # Re-copy sources from working tree USER root COPY . /vt/src/vitess.io/vitess -# Allow checkout of github.com/slackhq/vitess-addons (private repo) -ENV GOPRIVATE=github.com/slackhq/vitess-addons -RUN git config --global url.https://$GH_ACCESS_TOKEN@github.com/.insteadOf https://github.com/ - # Build Vitess RUN make build diff --git a/docker/base/Dockerfile.mysql80 b/docker/base/Dockerfile.mysql80 index 3a20f07dce3..d490d091aa8 100644 --- a/docker/base/Dockerfile.mysql80 +++ b/docker/base/Dockerfile.mysql80 @@ -16,16 +16,13 @@ ARG BUILD_GIT_BRANCH ARG BUILD_GIT_REV # Allows private repo go dependencies +ARG GOPRIVATE ARG GH_ACCESS_TOKEN # Re-copy sources from working tree USER root COPY . /vt/src/vitess.io/vitess -# Allow checkout of github.com/slackhq/vitess-addons (private repo) -ENV GOPRIVATE=github.com/slackhq/vitess-addons -RUN git config --global url.https://$GH_ACCESS_TOKEN@github.com/.insteadOf https://github.com/ - # Build Vitess RUN make build diff --git a/docker/base/Dockerfile.percona57 b/docker/base/Dockerfile.percona57 index 8551851d379..67db7f15394 100644 --- a/docker/base/Dockerfile.percona57 +++ b/docker/base/Dockerfile.percona57 @@ -30,16 +30,13 @@ ARG BUILD_GIT_BRANCH ARG BUILD_GIT_REV # Allows private repo go dependencies +ARG GOPRIVATE ARG GH_ACCESS_TOKEN # Re-copy sources from working tree USER root COPY . /vt/src/vitess.io/vitess -# Allow checkout of github.com/slackhq/vitess-addons (private repo) -ENV GOPRIVATE=github.com/slackhq/vitess-addons -RUN git config --global url.https://$GH_ACCESS_TOKEN@github.com/.insteadOf https://github.com/ - # Build Vitess RUN make build diff --git a/docker/base/Dockerfile.percona80 b/docker/base/Dockerfile.percona80 index ac1889e1ec3..3c8fcd8bcfa 100644 --- a/docker/base/Dockerfile.percona80 +++ b/docker/base/Dockerfile.percona80 @@ -30,16 +30,13 @@ ARG BUILD_GIT_BRANCH ARG BUILD_GIT_REV # Allows private repo go dependencies +ARG GOPRIVATE ARG GH_ACCESS_TOKEN # Re-copy sources from working tree USER root COPY . /vt/src/vitess.io/vitess -# Allow checkout of github.com/slackhq/vitess-addons (private repo) -ENV GOPRIVATE=github.com/slackhq/vitess-addons -RUN git config --global url.https://$GH_ACCESS_TOKEN@github.com/.insteadOf https://github.com/ - # Fix permissions RUN chown -R vitess:vitess /vt USER vitess