gableroux/gitlab-ci-lint
Docker image and script to lint .gitlab-ci.yml
files using https://gitlab.com/api/v4/ci/lint
.
Inspired by this gist
cat .gitlab-ci.yml | docker run --rm -i gableroux/gitlab-ci-lint
You'll need to install dependencies first if you go this way.
cat .gitlab-ci.yml | ./gitlab-ci-lint
# or
./gitlab-ci-lint .gitlab-ci.yml
.gitlab-ci.yml
test-ci-file:
image: gableroux/gitlab-ci-lint
script:
- gitlab-ci-lint .gitlab-ci.yml
gitlab-ci-lint () {
cat ${1:-.gitlab-ci.yml} | docker run --rm -i gableroux/gitlab-ci-lint
}
This way, you go in a project and type gitlab-ci-lint
or gitlab-ci-lint custom-gitlab-ci-file.yml
. :tada:
I wrote some project generators using cookiecutter and managed to generate .gitlab-ci.yml
files so I wanted to lint them in the ci to know when I break things.
You should not execute things from the internets, read your scripts before executing them.
Yeah why not? Feel this can be improved? Fork and send a PR. :tada:
docker pull gableroux/gitlab-ci-lint