Run in Gitlab CI
Here is below an example of how to run Packmind CLI within Gitlab CI.
packmind-cli:
stage: packmind
image:
name: packmind/packmind-cli:latest
entrypoint: [ "" ]
script:
- packmind-scanner scan src --gitlabMR true --formatters=console,sonarqube --output=packmind.json
artifacts:
paths:
- packmind.json
only:
refs:
- master
- merge_requests
There are two important elements here:
The
--gitlabMR true
command ensures that only modified files with a Merge Request are scanned over the analysis.
You'll have to set en env variable PACKMIND_GITLAB_TOKEN
with a personal/group access token with the read_api
The
merge_requests
at the bottom line ensure the CLI can be run within Merge Requests pipelines.
Last updated
Was this helpful?