This commit is contained in:
Kreyren 2020-02-24 01:29:07 +00:00
parent 355d1e66dd
commit 8af66605ae
4 changed files with 20 additions and 5 deletions

@ -12,13 +12,19 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: docker://hadolint/hadolint:latest
- uses: actions/checkout@v2
# - name: Installing dependencies..
# run: if ! apt list --installed | grep -qP "^hadolint -"; then apt install -y hadolint; fi
# run: |
# # Fix untill hadolint it available by downstream
# if ! apt-cache search hadolint | grep -qP "^hadolint -"; then
# # Install hadolint if not already installed through apt
# if ! apt list --installed | grep -qP "^hadolint -"; then
# if ! apt-cache search hadolint | grep -qP "^hadolint -.*"; then { if command -v wget >/dev/null; then apt install -y wget; fi ;} && wget https://github.com/hadolint/hadolint/releases/download/v1.17.5/hadolint-Linux-x86_64 -O /usr/bin/hadolint && { [ ! -x hadolint ] && chmod +x /usr/bin/hadolint ;}; elif apt-cache search hadolint | grep -qP "^hadolint -.*"; then apt install -y hadolint; fi
# fi
# fi
- name: Linting..
run: |
cd "$GITHUB_WORKSPACE" && for file in $(git ls-tree --name-only -r ${{ github.sha }} | grep '\.Dockerfile$'); do
printf 'checking dockerfile %s using hadolint\n' "$file"
hadolint "$file"
docker run hadolint:latest hadolint "$file"
done

@ -12,3 +12,4 @@ vscode:
- timonwong.shellcheck@0.9.0:hsU/Rd39aqPYowTqL+DbXg==
- krosf.vscode-valgrind@0.0.1:YTn5lOY8OnPKJYDqJPr/Sg==
- matklad.rust-analyzer@0.1.20200217:zozmBmOg1N91pRISIsYXBg==
- exiasr.hadolint@0.3.0:/FkAW3eTb+z9O7VZAyAa0w==

@ -1,6 +1,8 @@
FROM debian:latest
# FIXME: Outputs `gitpod@ws-ce281d58-997b-44b8-9107-3f2da7feede3:/workspace/gitpod-tests1$` in terminal
# FIXME: Add hadolint executable
# To avoid bricked workspaces (https://github.com/gitpod-io/gitpod/issues/1171)
ARG DEBIAN_FRONTEND=noninteractive
@ -25,7 +27,9 @@ RUN useradd \
RUN apt update \
&& apt upgrade -y \
&& apt dist-upgrade -y \
&& apt install -y rustc \
&& apt install -y rustc cargo \
&& : "Install hadolint if not available in downstream" \
&& if ! apt-cache search hadolint | grep -qP "^hadolint -.*"; then { if command -v wget >/dev/null; then apt install -y wget; fi ;} && wget https://github.com/hadolint/hadolint/releases/download/v1.17.5/hadolint-Linux-x86_64 -O /usr/bin/hadolint && { [ ! -x hadolint ] && chmod +x /usr/bin/hadolint ;}; elif apt-cache search hadolint | grep -qP "^hadolint -.*"; then apt install -y hadolint; fi \
&& apt autoremove -y \
&& rm -rf /var/lib/apt/lists/*

@ -1,5 +1,7 @@
FROM gitpod/workspace-full-vnc:latest
# FIXME: Add hadolint executable
# To avoid bricked workspaces (https://github.com/gitpod-io/gitpod/issues/1171)
ARG DEBIAN_FRONTEND=noninteractive
@ -13,6 +15,8 @@ RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
&& apt-get upgrade -y \
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - \
&& apt dist-upgrade -y \
&& : "Install hadolint if not available in downstream" \
&& if ! apt-cache search hadolint | grep -qP "^hadolint -.*"; then { if command -v wget >/dev/null; then apt install -y wget; fi ;} && wget https://github.com/hadolint/hadolint/releases/download/v1.17.5/hadolint-Linux-x86_64 -O /usr/bin/hadolint && { [ ! -x hadolint ] && chmod +x /usr/bin/hadolint ;}; elif apt-cache search hadolint | grep -qP "^hadolint -.*"; then apt install -y hadolint; fi \
&& apt-get install -y clang valgrind shellcheck docker-ce docker-ce-cli containerd.io firefox tree xclip umbrello gnuplot fish zsh dia \
&& rm -rf /var/lib/apt/lists/* \
&& apt autoremove -y