GitLab: Feature Flag Code Usages
With this GitLab CI/CD pipeline, your DevCycle dashboard will be updated to display code snippets for each DevCycle variable usage within your project.
Note: This is intended to run when pushing changes to your main branch.
Create a new
.gitlab-ci.yml file in your GitLab repository or update the existing one. Add the code_usages stage and paste the following code into a code_usages:
- rm -rf devcycle-usages-ci-cd
- apt-get update && apt-get install -y jq
- export PATH=$(npm bin -g):$PATH
- git clone https://gitlab.com/devcycle/devcycle-usages-ci-cd.git
- node devcycle-usages-ci-cd/dist/index.js
Your DevCycle API credentials and project token are required to update the DevCycle dashboard.
When referencing your API client ID and secret, we recommend using GitLab CI/CD variables to store your credentials securely.
Your DevCycle API credentials and project token are required to update the DevCycle dashboard. These should be set as environment variables in your GitLab project settings:
|Your DevCycle project key, see Projects|
|Your organization's API client ID, see Organization Settings|
|Your organization's API client secret, see Organization Settings|
When setting these environment variables, we recommend you protect them to ensure they're only exposed to protected branches or tags and mask them to hide their values in job logs.
- Set the necessary environment variables in your GitLab project settings as described above.
- Add the provided
.gitlab-ci.yamlto your project root.
- Push your changes. The pipeline should run automatically when you push changes to your
For any issues, feedback, or questions, please feel free to open an issue on this repository.