summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorJonas Zohren <git-pbkyr@jzohren.de>2022-02-15 18:33:20 +0100
committerJonas Zohren <git-pbkyr@jzohren.de>2022-02-15 20:01:38 +0100
commitb21a44ca4cd5c5064f2991f62bd3c48074c4148b (patch)
treef279def0c780b1e6fc0b1696b6674defcdfa3660 /.gitlab-ci.yml
parente04d4ff15066c16ec5d812fb19db8ef2bb847fa3 (diff)
downloadconduit-b21a44ca4cd5c5064f2991f62bd3c48074c4148b.zip
feat(ci): Lint dockerfiles with hadolint
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml35
1 files changed, 35 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 71511ef..bd4ce79 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -272,6 +272,7 @@ test:sytest:
tags: ["docker"]
variables:
PLUGINS: "https://github.com/valkum/sytest_conduit/archive/master.tar.gz"
+ interruptible: true
before_script:
- "mkdir -p /app"
- "cp ./conduit-debug-x86_64-unknown-linux-musl /app/conduit"
@@ -292,6 +293,40 @@ test:sytest:
reports:
junit: "$CI_PROJECT_DIR/sytest.xml"
+test:dockerlint:
+ stage: "test"
+ needs: []
+ image: "ghcr.io/hadolint/hadolint:latest-alpine"
+ interruptible: true
+ script:
+ # First pass: Print for CI log:
+ - >
+ hadolint
+ --no-fail --verbose
+ ./Dockerfile
+ ./docker/ci-binaries-packaging.Dockerfile
+ # Then output the results into a json for GitLab to pretty-print this in the MR:
+ - >
+ hadolint
+ --format gitlab_codeclimate
+ --failure-threshold error
+ ./Dockerfile
+ ./docker/ci-binaries-packaging.Dockerfile > dockerlint.json
+ artifacts:
+ when: always
+ reports:
+ codequality: dockerlint.json
+ paths:
+ - dockerlint.json
+ rules:
+ - if: '$CI_COMMIT_REF_NAME != "master"'
+ changes:
+ - docker/*Dockerfile
+ - Dockerfile
+ - .gitlab-ci.yml
+ - if: '$CI_COMMIT_REF_NAME == "master"'
+ - if: '$CI_COMMIT_REF_NAME == "next"'
+
# --------------------------------------------------------------------- #
# Store binaries as package so they have download urls #
# --------------------------------------------------------------------- #