Azure DevOps

How to integrate Meterian with Azure DevOps pipeline

Integrating Meterian with Azure pipeline is quite simple and it requires one simple step. In the configuration file azure-pipelines.yml add this small snippet:

- script: |
docker run --rm \
--volume ${PWD}:/workspace --env METERIAN_API_TOKEN=$METERIAN_API_TOKEN \
meterian/cli
displayName: 'Run Meterian'

Then, either when creating the pipeline or just by opening the Edit panel, set the METERIAN_API_TOKEN environment variable. Please note that checking the 'Keep this value secret' option will prevent the script from working as it will not be able to read it.

To retrieve a Meterian Api Token simply go to the Meterian Dashboard, select the tab "Tokens" and create a new one, or use an existing one.

Meterian will be launched against the project source code every time a new change is committed and pushed in your repository.

How does it work

When the script specified in the configuration file is executed the latest version of the Meterian client gets downloaded in the home folder of the machine and the Meterian client launched against the source code.

At the end of the scan the pipeline task will pass or fail based on the scan results.