CircleCI
CircleCI is a cloud-based CI/CD system. You can build Qodana into your CircleCI pipelines using the CircleCI Qodana orb as described in this section.
Before you start
Qodana Cloud
All configuration examples in this section use a project token generated by Qodana Cloud. This token is required for the paid Qodana linters and optional for use with the Community linters. You can see these sections to learn how to generate the project token in the Qodana Cloud UI:
The project setup section explains how to generate a project token when first working with Qodana Cloud.
The Manage a project section explains how to create a project token within an existing Qodana Cloud organization.
Once you obtain the project token, you can use the QODANA_TOKEN variable for identifying in a pipeline or workflow.
If you are using a Qodana Cloud instance other than https://qodana.cloud/, override it by setting the QODANA_ENDPOINT environment variable.
Prepare your project
In your CircleCI organization settings, navigate to the section and define the
qodanacontext.In the section, click the
qodanacontext. In this context, define theQODANA_TOKENenvironment variable and save the project token as its value.In your CircleCI organization settings, navigate to the section. In this section, opt in to allow using uncertified public orbs.
If necessary, in your repository create the
.circleci/config.ymlfile that will contain a CircleCI configuration.
Basic configuration
In the .circleci/config.yml file, save the following configuration:
This table describes configuration elements:
Configuration block | Description |
|---|---|
| Invokes the CircleCI Qodana orb and configures its version |
| Refers to the |
| Invokes the |
This configuration will be extended in the sections below.
Baseline and quality gate
This configuration uses the args parameter to invoke the baseline and quality gate features:
Specific linter
This configuration sample uses the args parameter to run the specific linter like jetbrains/qodana-jvm:
Specific branch
This configuration instructs Qodana to analyze changes only on the main branch:
Commands and parameters
The CircleCI Qodana orb provides the scan command to let you analyze your project and report the results.
This table contains the list of optional string parameters that can be additionally used with the scan command.
Parameter | Description | Default value |
|---|---|---|
| Customize the generated cache hash |
|
| Customize the generated cache hash |
|
| Additional arguments of the Qodana CLI | No default value |
| Name of the analysis artifact, used for uploading analysis results |
|
| Directory for Qodana caches |
|
| Directory for storing the results of scanning |
|