Gitlab integration

Git integration is native

Introduction

You can integrate Flagship with Gitlab in order to synchronize your Flag references in your codebase with Flagship.

Using the Codebase Analyzer, Flagship can look through your entire codebase in order to check for the reference of flags inside your code.
The Flag references are then sent back to Flagship in order for you to view their references on the Flag page on the Flagship Platform.

How to integrate Flagship with Gitlab

You can set up the codebase analyzer to run on a specific step of your Gitlab CI pipeline:

.gitlab-ci.yml example:

analyze_flag_references:
  image: flagshipio/code-analyzer:master
  stage: analyze
  variables:
    REPOSITORY_URL: $CI_PROJECT_URL
    REPOSITORY_BRANCH: $CI_COMMIT_BRANCH
    FLAGSHIP_TOKEN: YOUR_FLAGSHIP_TOKEN
    ENVIRONMENT_ID: YOUR_ENVIRONMENT_ID
  script:
    - /root/code-analyser
  only:
    - master

For that integration you will need to fill out those parameters:

  • REPOSITORY_URL: the URL of the repository you want to analyze. This is needed in order to display the link to your flag reference inside the Flag page of the Flagship platform.
  • REPOSITORY_BRANCH: the branch of the repository you want to analyze. This is needed in order to display the link to your flag reference inside the Flag page of the Flagship platform.
  • FLAGSHIP_TOKEN: the Flagship API Token needed for the codebase analyzer to communicate Flag references to Flagship. API Tokens for more details.
  • ENVIRONMENT_ID: the Flagship environment ID needed for the codebase analyzer to communicate Flag references to Flagship. You can get the environment ID in the platform on Settings -> API Key & Settings

You can set up additional parameters to the Codebase Analyzer to customize further your integration. Codebase Analyzer ] for more details.

Any feedback? We would be really happy to have a quick chat!


Did this page help you?