From e901f314c72a05a0c1bcc6ac291c00cfe3fff1b4 Mon Sep 17 00:00:00 2001 From: Oleksandr Bystrov <63246999+abystrov@users.noreply.github.com> Date: Tue, 9 Jan 2024 11:48:55 +0100 Subject: [PATCH] Make possible to use private repos during the build --- .github/workflows/docker-helm.yml | 4 ++++ Dockerfile | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-helm.yml b/.github/workflows/docker-helm.yml index e9b3a8d0..7b3bc353 100644 --- a/.github/workflows/docker-helm.yml +++ b/.github/workflows/docker-helm.yml @@ -91,6 +91,8 @@ jobs: build-args: | BUILD_SHA=${{ steps.extract_info.outputs.head }} BUILD_VERSION=latest + private_repo=github.com/AccessibleAI/cnvrg-shim + git_auth=${{ secrets.CNVRG_RUNNER_AUTH }} - name: Build and push tagged image id: docker_build_tag @@ -104,6 +106,8 @@ jobs: build-args: | BUILD_SHA=${{ steps.extract_info.outputs.head }} BUILD_VERSION=${{ steps.tag_bump.outputs.new_tag }} + private_repo=github.com/AccessibleAI/cnvrg-shim + git_auth=${{ secrets.CNVRG_RUNNER_AUTH }} - name: Build and push tagged image id: docker_build_tag_branch diff --git a/Dockerfile b/Dockerfile index d07b5c2c..1cf0b67b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,10 @@ # Build the manager binary FROM golang:1.19.1 as builder + ARG git_auth -ENV GOPRIVATE=github.com/AccessibleAI/cnvrg-shim +ARG private_repo + +ENV GOPRIVATE=$private_repo WORKDIR /workspace RUN git config --global --add url.https://$git_auth@github.com/.insteadOf https://github.com/ # Copy the Go Modules manifests