Run in Gitlab CI

Here is below an example of how to run Packmind CLI within Gitlab CI.

packmind-cli:
  stage: packmind
  image:
    name: promyze/promyze-cli:latest
    entrypoint: [ "" ]
  script:
    - promyze-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:

  1. 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

  1. The merge_requests at the bottom line ensure the CLI can be run within Merge Requests pipelines.

Last updated