File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ COPY --from=make-cli /out/* .
95
95
FROM scratch AS cross
96
96
COPY --from=make-cross /out/* .
97
97
98
- FROM base as test
98
+ FROM base AS test
99
99
ENV CGO_ENABLED=0
100
100
ARG BUILD_TAGS
101
101
ARG GIT_TAG
@@ -106,11 +106,20 @@ RUN --mount=target=. \
106
106
GIT_TAG=${GIT_TAG} \
107
107
make -f builder.Makefile test
108
108
109
- FROM base as check-license-headers
109
+ FROM base AS check-license-headers
110
110
RUN go get -u github.com/kunalkushwaha/ltag
111
111
RUN --mount=target=. \
112
112
make -f builder.Makefile check-license-headers
113
113
114
- FROM base as check-go-mod
114
+ FROM base AS make-go-mod-tidy
115
+ COPY . .
116
+ RUN --mount=type=cache,target=/go/pkg/mod \
117
+ go mod tidy
118
+
119
+ FROM scratch AS go-mod-tidy
120
+ COPY --from=make-go-mod-tidy /compose-cli/go.mod .
121
+ COPY --from=make-go-mod-tidy /compose-cli/go.sum .
122
+
123
+ FROM base AS check-go-mod
115
124
COPY . .
116
125
RUN make -f builder.Makefile check-go-mod
Original file line number Diff line number Diff line change @@ -92,6 +92,9 @@ moby-cli-link: ## Create com.docker.cli symlink if does not already exist
92
92
validate-headers : # # Check license header for all files
93
93
@docker build . --target check-license-headers
94
94
95
+ go-mod-tidy : # # Run go mod tidy in a container and output resulting go.mod and go.sum
96
+ @docker build . --target go-mod-tidy --output .
97
+
95
98
validate-go-mod : # # Validate go.mod and go.sum are up-to-date
96
99
@docker build . --target check-go-mod
97
100
@@ -128,4 +131,4 @@ help: ## Show help
128
131
129
132
FORCE :
130
133
131
- .PHONY : all validate protos cli e2e-local cross test cache-clear lint check-dependencies serve classic-link help clean-aci-e2e
134
+ .PHONY : all validate protos cli e2e-local cross test cache-clear lint check-dependencies serve classic-link help clean-aci-e2e go-mod-tidy
You can’t perform that action at this time.
0 commit comments