From 71e51c115ddc4d8436e0bf65d6571578e0241c65 Mon Sep 17 00:00:00 2001 From: Carl Bordum Hansen Date: Tue, 28 Jan 2020 12:53:07 +0100 Subject: [PATCH] Add advanced Gitlab CI example (lint all shell scripts in git project) --- GitLab-CI.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/GitLab-CI.md b/GitLab-CI.md index e307e54..61e49a2 100644 --- a/GitLab-CI.md +++ b/GitLab-CI.md @@ -6,4 +6,17 @@ test: stage: test script: - shellcheck testScript.sh +``` + +Here is a CI job that will lint all shell scripts in a git repository: + +```yaml +test: + image: koalaman/shellcheck-alpine:latest + stage: test + before_script: + - apk update + - apk add git + script: + - git ls-files --exclude='*.sh' --ignored | xargs shellcheck ``` \ No newline at end of file