From scratch image of gitlab-ci-validate, by Oliver Bristow.
3.0K
This tool uses GitLab's CI config validation API endpoint to validate local config files.
If you don't want to use the command line, you can paste your config into https://gitlab.com/<your project>/-/ci/lint [ref]
One or more .gitlab-ci.yml are passed as arguments on the command line. Any errors will result in a non-zero exit code. The filename must end in .yml to pass, but doesn't have to be .gitlab-ci.yml.
$ gitlab-ci-validate ./good.yml ./maybe-good.yml ./bad.yml
PASS: ./good.yml
SOFT FAIL: ./maybe-good.yml
- Post https://gitlab.com/api/v4/ci/lint: dial tcp: lookup gitlab.com on 127.0.0.53:53: read udp 127.0.0.1:41487->127.0.0.53:53: i/o timeout
HARD FAIL: ./bad.yml
- jobs:storage config contains unknown keys: files
Each input file will be validated and one of 3 results will be printed for it:
The exit code will be:
You can also use a private GitLab host both as a flag or as an environment variable. The following are equivalent.
gitlab-ci-validate --host=http://user:[email protected]:8080 .gitlab-ci.yml
export GITLAB_HOST=http://user:[email protected]:8080
gitlab-ci-validate .gitlab-ci.yml
The flag has precedence over the environment variable.
When not specified the host used is by default https://gitlab.com
You can either use a premade binary from the releases page or you can install it using go get:
go get -u github.com/Code0x58/gitlab-ci-validate
Content type
Image
Digest
Size
28.4 MB
Last updated
about 7 years ago
docker pull sebiwi/gitlab-ci-validate