-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
- Loading branch information
Showing
537 changed files
with
64,718 additions
and
13,904 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,6 @@ | |
/man/man*/ | ||
/docs/yaml/gen/ | ||
profile.out | ||
/vndr.log | ||
|
||
# top-level go.mod is not meant to be checked in | ||
/go.mod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# syntax=docker/dockerfile:1.3-labs | ||
|
||
ARG GO_VERSION=1.16.11 | ||
ARG MODVENDOR_VERSION=v0.5.0 | ||
ARG MODOUTDATED_VERSION=v0.8.0 | ||
|
||
FROM golang:${GO_VERSION}-alpine AS base | ||
RUN apk add --no-cache bash git rsync | ||
WORKDIR /src | ||
ARG MODVENDOR_VERSION | ||
RUN --mount=type=cache,target=/root/.cache/go-build \ | ||
--mount=type=cache,target=/go/pkg/mod \ | ||
GO111MODULE=on go install "github.com/goware/modvendor@${MODVENDOR_VERSION}" | ||
|
||
FROM base AS vendored | ||
RUN --mount=target=/context \ | ||
--mount=target=.,type=tmpfs \ | ||
--mount=target=/go/pkg/mod,type=cache <<EOT | ||
set -e | ||
rsync -a /context/. . | ||
./scripts/vendor update | ||
mkdir /out | ||
cp -r vendor.mod vendor.sum vendor /out | ||
EOT | ||
|
||
FROM scratch AS update | ||
COPY --from=vendored /out /out | ||
|
||
FROM vendored AS validate | ||
RUN --mount=target=/context \ | ||
--mount=target=.,type=tmpfs <<EOT | ||
set -e | ||
rsync -a /context/. . | ||
git add -A | ||
rm -rf vendor | ||
cp -rf /out/* . | ||
./scripts/vendor validate | ||
EOT | ||
|
||
FROM psampaz/go-mod-outdated:${MODOUTDATED_VERSION} AS go-mod-outdated | ||
FROM base AS outdated | ||
ARG TIMESTAMP | ||
RUN --mount=target=.,rw \ | ||
--mount=target=/go/pkg/mod,type=cache \ | ||
--mount=from=go-mod-outdated,source=/home/go-mod-outdated,target=/usr/bin/go-mod-outdated \ | ||
./scripts/vendor outdated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eu | ||
|
||
TYP=$1 | ||
|
||
usage() { | ||
echo "usage: ./scripts/vendor <update|outdated>" | ||
exit 1 | ||
} | ||
|
||
if [ -z "$TYP" ]; then | ||
usage | ||
fi | ||
|
||
# create dummy go.mod, see comment in vendor.mod | ||
cat > go.mod <<EOL | ||
module github.com/docker/cli | ||
go 1.16 | ||
EOL | ||
|
||
update() { | ||
(set -x ; go mod vendor -modfile=vendor.mod) | ||
if [ ! -x "$(command -v modvendor)" ]; then | ||
echo "modvendor not found. Install with 'go install github.com/goware/modvendor@v0.5.0'" | ||
exit 1 | ||
fi | ||
(set -x ; modvendor -copy="**/*.c **/*.h **/*.proto" -v) | ||
} | ||
|
||
validate() { | ||
(set -x ; go mod tidy -modfile=vendor.mod) | ||
diff=$(git status --porcelain -- vendor.mod vendor.sum vendor) | ||
if [ -n "$diff" ]; then | ||
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "make -f docker.Makefile vendor"' | ||
echo "$diff" | ||
exit 1 | ||
fi | ||
} | ||
|
||
outdated() { | ||
if [ ! -x "$(command -v go-mod-outdated)" ]; then | ||
echo "go-mod-outdated not found. Install with 'go install github.com/psampaz/go-mod-outdated@v0.8.0'" | ||
exit 1 | ||
fi | ||
(set -x ; go list -mod=vendor -mod=readonly -modfile=vendor.mod -u -m -json all | go-mod-outdated -update -direct) | ||
} | ||
|
||
case $TYP in | ||
"update") | ||
update | ||
;; | ||
"validate") | ||
update | ||
validate | ||
;; | ||
"outdated") | ||
outdated | ||
;; | ||
*) | ||
echo >&2 "Unknown type $TYP" | ||
exit 1 | ||
;; | ||
esac |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.