Documentation

Integrating Sigrid CI with Mendix QSM on a GitLab server

Please note: QSM is the brand name used by Mendix, in this manual we will use Sigrid.

This documentation covers cloud-based Sigrid. For on-premise Sigrid, refer to the section about on-premise analysis configuration.

Prerequisites

On-boarding your system to Sigrid

On-boarding is done automatically when you first run Sigrid CI. As long as you have a valid token, you will receive the message system has been on-boarded to Sigrid. Subsequent runs will then be visible in both your CI environment and sigrid-says.com.

Configuration

Step 1: Configure both the Sigrid credential and the Mendix PAT to environment variables

Sigrid CI reads your credentials from 2 environment variables called SIGRID_CI_TOKEN and MENDIX_TOKEN. To add these to your GitLab CI pipeline, follow these steps:

These instructions describe how to configure a single GitLab project, but you can follow the same steps to configure the entire GitLab group, which will make the environment variables available to all projects within that group.

Step 2: Create pipeline configuration file for Gitlab

We will create a pipeline that consists of two jobs:

In the root of your repository, create a file .gitlab-ci.yml and add the following contents:

stages:
 - report

variables:
  SIGRID_CI_CUSTOMER: '<example_customer_name>'
  SIGRID_CI_SYSTEM: '<example_system_name>'

sigridci:
  image: 
    name: softwareimprovementgroup/mendixpreprocessor:latest
    entrypoint: [""]
  stage: report
  script: 
    - /usr/local/bin/entrypoint.sh
  artifacts:
    paths:
      - "sigrid-ci-output/*"
    reports:
      junit: "sigrid-ci-output/sigridci-junit-format-report.xml"
    expire_in: 1 week
    when: always
  rules:
    - if: $CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH

sigridpublish:
  image: 
    name: softwareimprovementgroup/mendixpreprocessor:latest
    entrypoint: [""]
  variables:
    SIGRID_CI_PUBLISH: 'publish'
  stage: report
  script:
    - /usr/local/bin/entrypoint.sh
  artifacts:
    paths:
      - "sigrid-ci-output/*"
    reports:
      junit: "sigrid-ci-output/sigridci-junit-format-report.xml"
    expire_in: 1 week
    when: always
  rules:
    - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH

Note the name of the branch, which is main in the example but might be different for your repository. In general, most older projects will use master as their main branch, while more recent projects will use main.

The docker image allows a few optional environment variables to be set, that are equivalent to client script options of the full Sigrid CI script. Optional variables are:

Finally, note that you need to perform this step for every project where you wish to use Sigrid CI.

The output consists of the following:

Contact and support

Feel free to contact SIG’s support department for any questions or issues you may have after reading this document, or when using Sigrid or Sigrid CI. Users in Europe can also contact us by phone at +31 20 314 0953.

On this page