mirror of https://github.com/docker/docs.git
validate vendor target
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
parent
fc6d7a28b4
commit
77ea1f9bc3
|
@ -91,6 +91,7 @@ jobs:
|
||||||
- test-go-redirects
|
- test-go-redirects
|
||||||
- dockerfile-lint
|
- dockerfile-lint
|
||||||
- path-warnings
|
- path-warnings
|
||||||
|
- validate-vendor
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
|
|
19
Dockerfile
19
Dockerfile
|
@ -14,7 +14,8 @@ RUN apk add --no-cache \
|
||||||
git \
|
git \
|
||||||
nodejs \
|
nodejs \
|
||||||
npm \
|
npm \
|
||||||
gcompat
|
gcompat \
|
||||||
|
rsync
|
||||||
|
|
||||||
# npm downloads Node.js dependencies
|
# npm downloads Node.js dependencies
|
||||||
FROM base AS npm
|
FROM base AS npm
|
||||||
|
@ -87,6 +88,22 @@ FROM scratch AS vendor
|
||||||
COPY --from=update-modules /project/_vendor /_vendor
|
COPY --from=update-modules /project/_vendor /_vendor
|
||||||
COPY --from=update-modules /project/go.* /
|
COPY --from=update-modules /project/go.* /
|
||||||
|
|
||||||
|
FROM base AS validate-vendor
|
||||||
|
RUN --mount=target=/context \
|
||||||
|
--mount=type=bind,from=vendor,target=/out \
|
||||||
|
--mount=target=.,type=tmpfs <<EOT
|
||||||
|
set -e
|
||||||
|
rsync -a /context/. .
|
||||||
|
git add -A
|
||||||
|
rm -rf _vendor
|
||||||
|
cp -rf /out/* .
|
||||||
|
if [ -n "$(git status --porcelain -- go.mod go.sum _vendor)" ]; then
|
||||||
|
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "make vendor"'
|
||||||
|
git status --porcelain -- go.mod go.sum _vendor
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
EOT
|
||||||
|
|
||||||
# build-upstream builds an upstream project with a replacement module
|
# build-upstream builds an upstream project with a replacement module
|
||||||
FROM build-base AS build-upstream
|
FROM build-base AS build-upstream
|
||||||
# UPSTREAM_MODULE_NAME is the canonical upstream repository name and namespace (e.g. moby/buildkit)
|
# UPSTREAM_MODULE_NAME is the canonical upstream repository name and namespace (e.g. moby/buildkit)
|
||||||
|
|
|
@ -36,7 +36,7 @@ target "release" {
|
||||||
}
|
}
|
||||||
|
|
||||||
group "validate" {
|
group "validate" {
|
||||||
targets = ["lint", "test", "unused-media", "test-go-redirects", "dockerfile-lint", "path-warnings"]
|
targets = ["lint", "test", "unused-media", "test-go-redirects", "dockerfile-lint", "path-warnings", "validate-vendor"]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "test" {
|
target "test" {
|
||||||
|
@ -157,6 +157,11 @@ target "vendor" {
|
||||||
provenance = false
|
provenance = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
target "validate-vendor" {
|
||||||
|
target = "validate-vendor"
|
||||||
|
output = ["type=cacheonly"]
|
||||||
|
}
|
||||||
|
|
||||||
variable "UPSTREAM_MODULE_NAME" {
|
variable "UPSTREAM_MODULE_NAME" {
|
||||||
default = null
|
default = null
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue