Skip to main content

GitLab CI/CD

This section describes how to use the ConfigCat CLI in GitLab CI/CD to scan your source code for feature flag and setting usages and upload the found code references to ConfigCat.


  1. Create a new ConfigCat Management API credential and store its values in GitLab's CI/CD Variables with the following names: CONFIGCAT_API_USER, CONFIGCAT_API_PASS.

  2. Get your selected Config's ID.

  3. Create a new or open your existing .gitlab-ci.yml file, and put the following job into it.
    Don't forget to replace the PASTE-YOUR-CONFIG-ID-HERE value with your actual Config ID.

    stage: deploy # the job will run in the deploy phase, but you can choose from any other phases you have
    name: configcat/cli:1.3.0
    entrypoint: [""]
    - configcat scan $CI_PROJECT_DIR
    --runner="ConfigCat GitLab Job"
  4. Commit & push your changes.

Scan reports are uploaded for each branch of your repository that triggers the job.