File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ .PHONY : all
2+ all :
3+
4+ .PHONY : vendor
5+ vendor :
6+ $(eval $@ _TMP_OUT := $(shell mktemp -d -t policy-helpers-output.XXXXXXXXXX) )
7+ docker buildx bake --set " *.output=type=local,dest=$( $@ _TMP_OUT) " vendor
8+ rm -rf ./vendor
9+ cp -R " $( $@ _TMP_OUT) " /* ./
10+ rm -rf " $( $@ _TMP_OUT) " /*
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ ARG ALPINE_VERSION=3.23
55ARG MODOUTDATED_VERSION=v0.9.0
66
77FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS base
8+ ENV GOFLAGS="-mod=vendor"
89RUN apk add --no-cache git rsync
910WORKDIR /src
1011
@@ -15,8 +16,9 @@ RUN --mount=target=/context \
1516 set -e
1617 rsync -a /context/. .
1718 go mod tidy
19+ go mod vendor
1820 mkdir /out
19- cp -r go.mod go.sum /out
21+ cp -r go.mod go.sum vendor /out
2022EOT
2123
2224FROM scratch AS update
@@ -28,10 +30,11 @@ RUN --mount=target=/context \
2830 set -e
2931 rsync -a /context/. .
3032 git add -A
33+ rm -rf vendor
3134 cp -rf /out/* .
32- if [ -n "$(git status --porcelain -- go.mod go.sum)" ]; then
33- echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor"'
34- git status --porcelain -- go.mod go.sum
35+ if [ -n "$(git status --porcelain -- go.mod go.sum vendor )" ]; then
36+ echo >&2 'ERROR: Vendor result differs. Please vendor your package with "make vendor"'
37+ git status --porcelain -- go.mod go.sum vendor
3538 exit 1
3639 fi
3740EOT
You can’t perform that action at this time.
0 commit comments