зеркало из https://github.com/docker/hub-tool.git
build: Run validate headers in build step
Signed-off-by: Chris Crone <christopher.crone@docker.com>
This commit is contained in:
Родитель
2fa5610a91
Коммит
97db9e6999
|
@ -27,6 +27,7 @@ ARG GOLANGCI_LINT_VERSION=v1.33.0-alpine
|
|||
FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS builder
|
||||
WORKDIR /go/src/github.com/docker/hub-tool
|
||||
RUN apk add --no-cache \
|
||||
bash \
|
||||
git \
|
||||
make
|
||||
|
||||
|
@ -51,6 +52,14 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
|
|||
--mount=type=cache,target=/root/.cache/golangci-lint \
|
||||
make -f builder.Makefile lint
|
||||
|
||||
####
|
||||
# VALIDATE HEADERS
|
||||
####
|
||||
FROM builder AS validate-headers
|
||||
RUN --mount=type=cache,target=/root/.cache/go-build \
|
||||
--mount=type=cache,target=/go/pkg \
|
||||
go get -u github.com/kunalkushwaha/ltag && ./scripts/validate/fileheader
|
||||
|
||||
####
|
||||
# CHECK GO MOD
|
||||
####
|
||||
|
|
4
Makefile
4
Makefile
|
@ -111,9 +111,7 @@ lint: ## Run the go linter
|
|||
|
||||
.PHONY: validate-headers
|
||||
validate-headers: ## Validate files license header
|
||||
docker run --rm -v $(CURDIR):/work -w /work \
|
||||
golang:${GO_VERSION} \
|
||||
bash -c 'go get -u github.com/kunalkushwaha/ltag && ./scripts/validate/fileheader'
|
||||
@docker build $(BUILD_ARGS) . --target validate-headers
|
||||
|
||||
.PHONY: validate-go-mod
|
||||
validate-go-mod: ## Validate go.mod and go.sum are up-to-date
|
||||
|
|
Загрузка…
Ссылка в новой задаче