GitLab CI/CD is a tool for software development that uses various CI/CD methodologies. This section explains how you can run Qodana Docker images within GitLab CI/CD pipelines and covers the following cases:
The cache keyword configures GitLab caches to store the Qodana cache, so subsequent runs will be faster.
The script keyword runs the qodana command and enumerates the Qodana configuration options described in the Shell commands section.
The variables keyword defines the QODANA_TOKENvariable referring to the project token generated in Qodana Cloud. This token is required by the paid Qodana linters, and is optional for using with the Community linters.
You can see these sections to learn how to generate the project token:
The Onboarding section explains how to get the project token generated while first working with Qodana Cloud
The Manage a project section explains how to create a project in the existing Qodana Cloud organization
Inspect specific branches
Using the only keyword, you can tell Qodana which branches to inspect. To inspect only the main branch and incoming merge requests, you can use this configuration: