mirror of https://github.com/docker/cli.git
validate authors target
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
ede32747b5
commit
bea6c0d242
|
@ -20,6 +20,7 @@ jobs:
|
||||||
- lint
|
- lint
|
||||||
- shellcheck
|
- shellcheck
|
||||||
- validate-vendor
|
- validate-vendor
|
||||||
|
- update-authors # ensure authors update target runs fine
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
|
|
|
@ -114,6 +114,20 @@ target "mod-outdated" {
|
||||||
output = ["type=cacheonly"]
|
output = ["type=cacheonly"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
target "validate-authors" {
|
||||||
|
inherits = ["_common"]
|
||||||
|
dockerfile = "./dockerfiles/Dockerfile.authors"
|
||||||
|
target = "validate"
|
||||||
|
output = ["type=cacheonly"]
|
||||||
|
}
|
||||||
|
|
||||||
|
target "update-authors" {
|
||||||
|
inherits = ["_common"]
|
||||||
|
dockerfile = "./dockerfiles/Dockerfile.authors"
|
||||||
|
target = "update"
|
||||||
|
output = ["."]
|
||||||
|
}
|
||||||
|
|
||||||
target "test" {
|
target "test" {
|
||||||
target = "test"
|
target = "test"
|
||||||
output = ["type=cacheonly"]
|
output = ["type=cacheonly"]
|
||||||
|
|
|
@ -97,7 +97,7 @@ mod-outdated: ## check outdated dependencies
|
||||||
|
|
||||||
.PHONY: authors
|
.PHONY: authors
|
||||||
authors: ## generate AUTHORS file from git history
|
authors: ## generate AUTHORS file from git history
|
||||||
$(DOCKER_RUN) -it $(DEV_DOCKER_IMAGE_NAME) make authors
|
docker buildx bake update-authors
|
||||||
|
|
||||||
.PHONY: manpages
|
.PHONY: manpages
|
||||||
manpages: build_docker_image ## generate man pages from go source and markdown
|
manpages: build_docker_image ## generate man pages from go source and markdown
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
# syntax=docker/dockerfile:1.3-labs
|
||||||
|
|
||||||
|
FROM alpine:3.14 AS gen
|
||||||
|
RUN apk add --no-cache bash git
|
||||||
|
WORKDIR /src
|
||||||
|
RUN --mount=type=bind,target=. \
|
||||||
|
mkdir /out && ./scripts/docs/generate-authors.sh /out
|
||||||
|
|
||||||
|
FROM scratch AS update
|
||||||
|
COPY --from=gen /out /
|
||||||
|
|
||||||
|
FROM gen AS validate
|
||||||
|
RUN --mount=type=bind,target=.,rw <<EOT
|
||||||
|
set -e
|
||||||
|
git add -A
|
||||||
|
cp -rf /out/* .
|
||||||
|
diff=$(git status --porcelain -- AUTHORS)
|
||||||
|
if [ -n "$diff" ]; then
|
||||||
|
echo >&2 'ERROR: Authors result differs. Please update with "make -f docker.Makefile authors"'
|
||||||
|
echo "$diff"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
EOT
|
|
@ -1,10 +1,8 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
cd "$(dirname "$(readlink -f "${BASH_SOURCE[*]}")")/../.."
|
|
||||||
|
|
||||||
# see also ".mailmap" for how email addresses and names are deduplicated
|
# see also ".mailmap" for how email addresses and names are deduplicated
|
||||||
|
OUT="${1:-.}"
|
||||||
{
|
{
|
||||||
cat <<-'EOH'
|
cat <<-'EOH'
|
||||||
# This file lists all individuals having contributed content to the repository.
|
# This file lists all individuals having contributed content to the repository.
|
||||||
|
@ -12,4 +10,5 @@ cd "$(dirname "$(readlink -f "${BASH_SOURCE[*]}")")/../.."
|
||||||
EOH
|
EOH
|
||||||
echo
|
echo
|
||||||
git log --format='%aN <%aE>' | LC_ALL=C.UTF-8 sort -uf
|
git log --format='%aN <%aE>' | LC_ALL=C.UTF-8 sort -uf
|
||||||
} > AUTHORS
|
} > "$OUT/AUTHORS"
|
||||||
|
cat "$OUT/AUTHORS"
|
||||||
|
|
Loading…
Reference in New Issue