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:
- docker:dind
stages:
- lint
- build
variables:
DOCKER_DRIVER: overlay2
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
image: docker:latest
<<: *transform-job-name
script:
# Disable bash history to prevent the $CI_JOB_TOKEN to be recorded and saved
- unset HISTFILE
......@@ -21,17 +35,32 @@ variables:
- rm /root/.docker/config.json
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
debian:
build-debian:
<<: *build-docker-image
fedora:
build-fedora:
<<: *build-docker-image
gentoo:
build-gentoo:
<<: *build-docker-image
linting:
build-linting:
<<: *build-docker-image
ignored:
- DL3006
- DL3007
- DL3008
- DL3013
FROM fedora
RUN export FEDORA_VERSION=$(rpm -E %fedora) \
RUN FEDORA_VERSION="$(rpm -E %fedora)" \
&& export FEDORA_VERSION \
&& dnf install -y \
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/free/fedora/rpmfusion-free-release-"$FEDORA_VERSION".noarch.rpm \
https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-"$FEDORA_VERSION".noarch.rpm \
&& dnf update -y \
&& dnf install -y \
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