From 13159057d5f42e558ac772c18b3bd6dc0a0251cc Mon Sep 17 00:00:00 2001 From: ssube Date: Sun, 16 Jun 2019 19:16:52 -0500 Subject: [PATCH] rules(gitlab-ci): start validating jobs --- rules/gitlab-ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/rules/gitlab-ci.yml b/rules/gitlab-ci.yml index 6adbfcf..839a5e2 100644 --- a/rules/gitlab-ci.yml +++ b/rules/gitlab-ci.yml @@ -14,4 +14,50 @@ rules: stages: type: array items: - type: string \ No newline at end of file + type: string + + - name: gitlab-job-template + desc: template jobs should set the stage + level: info + tags: + - gitlab + - optional + + select: '$' + check: + type: object + patternProperties: + "\\..+": + type: object + required: [stage] + properties: + stage: + type: string + + - name: gitlab-job-script + desc: jobs must have a script + level: info + tags: + - gitlab + - important + + select: '$' + check: + type: object + patternProperties: + "^(?!stages$|\\.)": + type: object + required: [script] + properties: + after_script: + type: array + items: + type: string + before_script: + type: array + items: + type: string + script: + type: array + items: + type: string \ No newline at end of file