Sign inSign up

gableroux/gitlab-ci-lint

By gableroux

Updated about 5 years ago

Image
3

10K+

gableroux/gitlab-ci-lint repository overview

docker-gitlab-ci-lint

Docker Stars Docker Pulls Docker Automated Docker Build Image Version Layers

Docker image and script to lint .gitlab-ci.yml files using https://gitlab.com/api/v4/ci/lint.

Inspired by this gist

How to use

Docker image
cat .gitlab-ci.yml | docker run --rm -i gableroux/gitlab-ci-lint
Shell script

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
Handy function for your shell
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:

FAQ

Why?

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.

Is this safe?

You should not execute things from the internets, read your scripts before executing them.

Can I contribute

Yeah why not? Feel this can be improved? Fork and send a PR. :tada:

License

MIT © Gabriel Le Breton

Tag summary

Content type

Image

Digest

Size

23.2 MB

Last updated

over 5 years ago

docker pull gableroux/gitlab-ci-lint