Merge pull request #758 from crazy-max/mod-outdated

Mod outdated
This commit is contained in:
CrazyMax 2021-09-08 13:33:26 +02:00 committed by GitHub
commit ac9a1612d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 2 deletions

View File

@ -53,4 +53,7 @@ docs:
authors:
$(BUILDX_CMD) bake update-authors
mod-outdated:
$(BUILDX_CMD) bake mod-outdated
.PHONY: shell binaries binaries-cross install release validate-all lint validate-vendor validate-docs validate-authors vendor docs authors

View File

@ -76,6 +76,13 @@ target "update-authors" {
output = ["."]
}
target "mod-outdated" {
inherits = ["_common"]
dockerfile = "./hack/dockerfiles/vendor.Dockerfile"
target = "outdated"
output = ["type=cacheonly"]
}
target "test" {
inherits = ["_common"]
target = "test-coverage"

View File

@ -2,9 +2,11 @@
ARG GO_VERSION=1.17.0
FROM golang:${GO_VERSION}-alpine AS vendored
RUN apk add --no-cache git rsync
FROM golang:${GO_VERSION}-alpine AS base
RUN apk add --no-cache git rsync
WORKDIR /src
FROM base AS vendored
RUN --mount=target=/context \
--mount=target=.,type=tmpfs \
--mount=target=/go/pkg/mod,type=cache <<EOT
@ -33,3 +35,10 @@ if [ -n "$(git status --porcelain -- go.mod go.sum vendor)" ]; then
exit 1
fi
EOT
FROM psampaz/go-mod-outdated:v0.8.0 AS go-mod-outdated
FROM base AS outdated
RUN --mount=target=.,ro \
--mount=target=/go/pkg/mod,type=cache \
--mount=from=go-mod-outdated,source=/home/go-mod-outdated,target=/usr/bin/go-mod-outdated \
go list -mod=readonly -u -m -json all | go-mod-outdated -update -direct