forked from distribution/distribution
-
Notifications
You must be signed in to change notification settings - Fork 0
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 <[email protected]>
- Loading branch information
Showing
4 changed files
with
45 additions
and
5 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
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,23 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
ARG GO_VERSION=1.18 | ||
ARG ALPINE_VERSION=3.16 | ||
|
||
FROM alpine:${ALPINE_VERSION} AS base | ||
RUN apk add --no-cache git gpg | ||
|
||
FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS gitvalidation | ||
ARG GIT_VALIDATION_VERSION=v1.1.0 | ||
RUN --mount=type=cache,target=/root/.cache \ | ||
--mount=type=cache,target=/go/pkg/mod \ | ||
GOBIN=/out go install "github.com/vbatts/git-validation@${GIT_VALIDATION_VERSION}" | ||
|
||
FROM base AS validate | ||
ARG COMMIT_RANGE | ||
RUN if [ -z "$COMMIT_RANGE" ]; then echo "COMMIT_RANGE required" && exit 1; fi | ||
ENV GIT_CHECK_EXCLUDE="./vendor" | ||
WORKDIR /src | ||
RUN --mount=type=bind,target=. \ | ||
--mount=type=cache,target=/root/.cache \ | ||
--mount=from=gitvalidation,source=/out/git-validation,target=/usr/bin/git-validation \ | ||
git-validation -q -range "$COMMIT_RANGE" -run short-subject,dangling-whitespace |