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 theqodana
context.In the
section, click theqodana
context. In this context, define theQODANA_TOKEN
environment variable and save the project token as its value.In your CircleCI organization settings, navigate to the uncertified public orbs.
section. In this section, opt in to allow usingIf necessary, in your repository create the
.circleci/config.yml
file 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 inspect 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 |
|