From 9105aceafdd63bfd3aeae33129cb3aec7948ce44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Socho=C5=84?= Date: Mon, 18 Jan 2021 20:45:42 +0100 Subject: [PATCH] Add GitLab pipeline snippet for containered exec Use official docker image instead of fetching binary files from GH. Setting empty entrypoint is needed to mitigate issues such as * ERR - unknown shorthand flag: 'c' in -c' --- docs/contrib.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/contrib.md b/docs/contrib.md index 16ab255..1a94e30 100644 --- a/docs/contrib.md +++ b/docs/contrib.md @@ -28,3 +28,20 @@ else exit 1 fi ``` + +## GitLab in container + +Below code fragment is basic example useful to verify files under `k8s/` subdirectory. +Adjust `stage` and subdirectory (`k8s/`) in `find` command accordingly to your project spec. + +```yaml +kubeval: + stage: lint + image: + name: garethr/kubeval + # force empty entrypoint, otherwise you will get + # err - unknown shorthand flag: 'c' in -c + entrypoint: [""] + script: + - find k8s/ -type f -name "*.yaml" -exec kubeval {} \; ; +```