From ee1e77efbee3e5f289ace6a0fbe85fe7c6600012 Mon Sep 17 00:00:00 2001 From: Shawn Wilsher <656602+sdwilsh@users.noreply.github.com> Date: Sun, 5 Feb 2023 09:10:51 -0800 Subject: [PATCH] robot: Add `hadolint` as part of the automatic lint checks (#818) * Pull out golint into its own target Signed-off-by: Shawn Wilsher <656602+sdwilsh@users.noreply.github.com> * run hadolint on the Docker files in images/ Signed-off-by: Shawn Wilsher <656602+sdwilsh@users.noreply.github.com> * Ignore existing failures of hadolint, at least for now Signed-off-by: Shawn Wilsher <656602+sdwilsh@users.noreply.github.com> --------- Signed-off-by: Shawn Wilsher <656602+sdwilsh@users.noreply.github.com> --- Earthfile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Earthfile b/Earthfile index 7444b72..02e184e 100644 --- a/Earthfile +++ b/Earthfile @@ -20,6 +20,7 @@ ARG CGO_ENABLED=0 ARG OSBUILDER_IMAGE=quay.io/kairos/osbuilder-tools:v0.3.3 ARG GOLINT_VERSION=1.47.3 ARG GO_VERSION=1.18 +ARG HADOLINT_VERSION=2.12.0 all: BUILD +docker @@ -141,7 +142,7 @@ dist: RUN goreleaser build --rm-dist --skip-validate --snapshot SAVE ARTIFACT /build/dist/* AS LOCAL dist/ -lint: +golint: ARG GO_VERSION FROM golang:$GO_VERSION ARG GOLINT_VERSION @@ -150,6 +151,18 @@ lint: COPY . . RUN golangci-lint run +hadolint: + ARG HADOLINT_VERSION + FROM hadolint/hadolint:$HADOLINT_VERSION-alpine + WORKDIR /images + COPY images . + RUN ls + RUN find . -name "Dockerfile*" -print | xargs -r -n1 hadolint + +lint: + BUILD +golint + BUILD +hadolint + luet: FROM quay.io/luet/base:$LUET_VERSION SAVE ARTIFACT /usr/bin/luet /luet