Skip to content
Snippets Groups Projects
Verified Commit 218ffd22 authored by georg's avatar georg
Browse files

CI: Introduce Dockerfile linting

parent 527ea238
No related branches found
No related tags found
No related merge requests found
--- ---
image: docker:latest
services: services:
- docker:dind - docker:dind
stages: stages:
- lint
- build - build
variables: variables:
DOCKER_DRIVER: overlay2 DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://docker:2375 DOCKER_HOST: tcp://docker:2375
.transform-job-name: &transform-job-name
before_script:
- CI_JOB_NAME="$(echo $CI_JOB_NAME | cut -d - -f 2)"
- export CI_JOB_NAME
.lint-dockerfile: &lint-dockerfile
image: hadolint/hadolint:latest-debian
<<: *transform-job-name
script:
- hadolint $CI_JOB_NAME
stage: lint
.build-docker-image: &build-docker-image .build-docker-image: &build-docker-image
image: docker:latest
<<: *transform-job-name
script: script:
# Disable bash history to prevent the $CI_JOB_TOKEN to be recorded and saved # Disable bash history to prevent the $CI_JOB_TOKEN to be recorded and saved
- unset HISTFILE - unset HISTFILE
...@@ -21,17 +35,32 @@ variables: ...@@ -21,17 +35,32 @@ variables:
- rm /root/.docker/config.json - rm /root/.docker/config.json
stage: build stage: build
archlinux: lint-archlinux:
<<: *lint-dockerfile
lint-debian:
<<: *lint-dockerfile
lint-fedora:
<<: *lint-dockerfile
lint-gentoo:
<<: *lint-dockerfile
lint-linting:
<<: *lint-dockerfile
build-archlinux:
<<: *build-docker-image <<: *build-docker-image
debian: build-debian:
<<: *build-docker-image <<: *build-docker-image
fedora: build-fedora:
<<: *build-docker-image <<: *build-docker-image
gentoo: build-gentoo:
<<: *build-docker-image <<: *build-docker-image
linting: build-linting:
<<: *build-docker-image <<: *build-docker-image
ignored:
- DL3006
- DL3007
- DL3008
- DL3013
FROM fedora FROM fedora
RUN export FEDORA_VERSION=$(rpm -E %fedora) \ RUN FEDORA_VERSION="$(rpm -E %fedora)" \
&& export FEDORA_VERSION \
&& dnf install -y \ && dnf install -y \
https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$FEDORA_VERSION.noarch.rpm \ https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-"$FEDORA_VERSION".noarch.rpm \
https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$FEDORA_VERSION.noarch.rpm \ https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-"$FEDORA_VERSION".noarch.rpm \
&& dnf update -y \ && dnf update -y \
&& dnf install -y \ && dnf install -y \
cairo \ cairo \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment