From a8b2c78fe31216dc025242526f3b7b2f17b8e27a Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sun, 13 Sep 2020 01:42:28 +0200 Subject: [PATCH] Add block for git-credential Signed-off-by: Knut Ahlers --- .config/gen-dockerfile.tpl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.config/gen-dockerfile.tpl b/.config/gen-dockerfile.tpl index 6073e47..ec1479b 100755 --- a/.config/gen-dockerfile.tpl +++ b/.config/gen-dockerfile.tpl @@ -1,5 +1,15 @@ FROM golang:alpine as builder +{{ if hasFeature "private-mods" -}} +ARG VAULT_ADDR +ARG VAULT_TOKEN + +RUN set -ex \ + && apk --no-cache add git \ + && GOPATH=/usr/local go get -u -v github.com/Luzifer/git-credential-vault \ + && git config --global credential.helper 'vault --vault-path-prefix secret/jenkins/git-credential' +{{- end }} + COPY . /go/src/{{ .package }} WORKDIR /go/src/{{ .package }}