From 4a42222019300320829f88aabc3d64286df3bcaa Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 16 May 2023 16:57:09 +0200 Subject: [PATCH] ci: add .drone.yml hadolint: override severity of a warning --- .drone.yml | 68 +++++++++++++++++++++++++++++++++++++++++ .hadolint.yaml | 7 +++++ .pre-commit-config.yaml | 2 ++ 3 files changed, 77 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..362ba05 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,68 @@ +--- +kind: pipeline +type: docker +name: testing + +platform: + os: linux + arch: amd64 + +steps: + - name: hadolint + pull: always + image: ghcr.io/hadolint/hadolint:v2.12.0-alpine + commands: + - hadolint --version + - hadolint Containerfile + when: + ref: + - refs/heads/development + - refs/heads/feature-** + - refs/pull/** + - refs/tags/** + event: + exclude: [cron] + + - name: kaniko-build + pull: always + image: docker.io/immawanderer/drone-kaniko:linux-amd64 + settings: + dockerfile: Containerfile + context: . + args: + - BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" + - VCS_REF=${DRONE_COMMIT_SHA:0:7} + when: + ref: + - refs/heads/feature-** + - refs/pull/** + - refs/tags/** + event: + exclude: [cron] + + - name: kaniko-publish + pull: always + image: docker.io/immawanderer/drone-kaniko:linux-amd64 + settings: + dockerfile: Containerfile + context: . + args: + - BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" + - VCS_REF=${DRONE_COMMIT_SHA:0:7} + tags: + - latest + - linux-amd64 + - ${DRONE_COMMIT_SHA:0:8} + repo: immawanderer/${DRONE_REPO_NAME} + username: immawanderer + password: + from_secret: dh_token + when: + ref: + - refs/heads/development + event: + exclude: [pull_request, tag] + +trigger: + event: [push, pull_request, cron, tag] +... diff --git a/.hadolint.yaml b/.hadolint.yaml index 3cc5e59..32bfeb8 100644 --- a/.hadolint.yaml +++ b/.hadolint.yaml @@ -1,2 +1,9 @@ --- ignored: + +failure-threshold: warning + +override: + info: + # DL3018 warning: Pin versions in apk add. Instead of `apk add ` use `apk add =` + - DL3018 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d3e976f..45f9818 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,6 +5,8 @@ repos: rev: v4.2.0 hooks: - id: check-merge-conflict + - id: check-yaml + exclude: .drone.yml - repo: https://git.dotya.ml/wanderer/hadolint-pre-commit rev: v0.0.1 hooks: