github.com/pdmccormick/importable-docker-buildx@v0.0.0-20240426161518-e47091289030/hack/dockerfiles/authors.Dockerfile (about)

     1  # syntax=docker/dockerfile:1
     2  
     3  FROM alpine:3.14 AS gen
     4  RUN apk add --no-cache git
     5  WORKDIR /src
     6  RUN --mount=type=bind,target=. <<EOT
     7  #!/usr/bin/env bash
     8  set -e
     9  mkdir /out
    10  # see also ".mailmap" for how email addresses and names are deduplicated
    11  {
    12    echo "# This file lists all individuals having contributed content to the repository."
    13    echo "# For how it is generated, see hack/dockerfiles/authors.Dockerfile."
    14    echo
    15    git log --format='%aN <%aE>' | LC_ALL=C.UTF-8 sort -uf
    16  } > /out/AUTHORS
    17  cat /out/AUTHORS
    18  EOT
    19  
    20  FROM scratch AS update
    21  COPY --from=gen /out /
    22  
    23  FROM gen AS validate
    24  RUN --mount=type=bind,target=.,rw <<EOT
    25  set -e
    26  git add -A
    27  cp -rf /out/* .
    28  if [ -n "$(git status --porcelain -- AUTHORS)" ]; then
    29    echo >&2 'ERROR: Authors result differs. Please update with "make authors"'
    30    git status --porcelain -- AUTHORS
    31    exit 1
    32  fi
    33  EOT