File: Dockerfile.authors

package info (click to toggle)
docker.io 28.5.2%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 69,048 kB
  • sloc: sh: 5,867; makefile: 863; ansic: 184; python: 162; asm: 159
file content (27 lines) | stat: -rw-r--r-- 702 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# syntax=docker/dockerfile:1

# ALPINE_VERSION sets the version of the alpine base image to use.
# It must be a supported tag in the docker.io/library/alpine image repository.
ARG ALPINE_VERSION=3.21

FROM alpine:${ALPINE_VERSION} 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. Update with "make -f docker.Makefile authors"'
  echo "$diff"
  exit 1
fi
EOT