GitLab CI/CD
How to integrate with GitLab CICD pipelines
This step by step guide will help you integrate Meterian in your GitLab CI/CD pipelines.
Set the METERIAN_API_TOKEN environment variable
- From the menu select Setting > CI / CD
- “Expand” the Variables section
- Add new variable
- Check the “Mask variable” option
To retrieve a Meterian API Token visit the Meterian Dashboard; in your account select the tab "Tokens" and create a new one, or use an existing one.
Add Meterian to the pipeline
meterian-analysis:
image: docker:stable
services:
- docker:18.09.7-dind
stage: test
script:
- ROOT=`pwd`
- docker pull --quiet meterian/cli
- METERIAN_CLI_OPT="[OPTIONS]"
- docker run --rm --volume $ROOT:/workspace --env METERIAN_API_TOKEN=$METERIAN_API_TOKEN meterian/cli $METERIAN_CLI_OPT
Some further examples are available:
Last modified 1yr ago