Loading .gitlab-ci.yml +5 −1 Original line number Diff line number Diff line Loading @@ -9,11 +9,15 @@ ci-fairy: stage: test script: # ci-fairy doesn't fail on errors, so I workaround that. - ./test.py - echo "${CI_JOB_TOKEN:-not defined}" | head -c4; echo - AUTHFILE="$(mktemp)" - echo "$CI_JOB_TOKEN" > "$AUTHFILE" - logfile="$(mktemp)" - | for template in templates/*.yml do echo "Checking $template" >&2 ci-fairy lint --filename "$template" 2>&1 | tee -a "$logfile" ci-fairy -vvv --authfile "$AUTHFILE" lint --filename "$template" 2>&1 | tee -a "$logfile" done - '! grep -q ERROR "$logfile"' test.py 0 → 100755 +7 −0 Original line number Diff line number Diff line #!/usr/bin/env python3 import gitlab import os gl = gitlab.Gitlab(os.environ["CI_SERVER_URL"], job_token=os.environ["CI_JOB_TOKEN"]) gl.lint(open(".gitlab-ci.yml").read()) Loading
.gitlab-ci.yml +5 −1 Original line number Diff line number Diff line Loading @@ -9,11 +9,15 @@ ci-fairy: stage: test script: # ci-fairy doesn't fail on errors, so I workaround that. - ./test.py - echo "${CI_JOB_TOKEN:-not defined}" | head -c4; echo - AUTHFILE="$(mktemp)" - echo "$CI_JOB_TOKEN" > "$AUTHFILE" - logfile="$(mktemp)" - | for template in templates/*.yml do echo "Checking $template" >&2 ci-fairy lint --filename "$template" 2>&1 | tee -a "$logfile" ci-fairy -vvv --authfile "$AUTHFILE" lint --filename "$template" 2>&1 | tee -a "$logfile" done - '! grep -q ERROR "$logfile"'
test.py 0 → 100755 +7 −0 Original line number Diff line number Diff line #!/usr/bin/env python3 import gitlab import os gl = gitlab.Gitlab(os.environ["CI_SERVER_URL"], job_token=os.environ["CI_JOB_TOKEN"]) gl.lint(open(".gitlab-ci.yml").read())