Jenkins is a self-contained, open-source server that automates software-related tasks including building, testing, and deploying software. This section explains how you can configure Qodana Docker images in Jenkins Multibranch Pipelines
Prepare your project
Make sure that these plugins are installed on your Jenkins instance:
git is required for git operations in Jenkins projects
Make sure that Docker is installed and accessible by Jenkins.
If applicable, make sure that Docker is accessible by the
jenkins user as described in the Manage Docker as a non-root user section of the Docker documentation.
Create a Multibranch Pipeline project as described on the Jenkins documentation portal.
In the root directory of your project repository, create the
Jenkinsfile. This file will contain Jenkins configuration scripts described in this section.
This is the basic configuration of the Jenkins Pipeline.
In this configuration, the
environment block defines the
QODANA_TOKEN variable to invoke the project token generated in Qodana Cloud and contained in the
qodana-token global credentials. The project 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 in Qodana Cloud:
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
This configuration uses the
docker agent to invoke Qodana Docker images. Using the
WORKSPACE variable, the
args block mounts the local checkout directory to the project directory of a Docker image, and
image specifies the Docker image invoked.
Inspect specific branches
when block, you can tell Qodana which branches of your project to inspect. For example, this configuration lets you inspect only the
You can inspect pull requests as described in the Supporting Pull Requests section of the Jenkins documentation.