Jenkins
Jenkins is a self-contained, open source server for automation of software-related tasks such as building, testing, and deployment of software. To perform tasks, Jenkins uses the Pipeline functionality.
To be able to run Qodana in Jenkins, make sure that the Docker and Docker Pipeline plugins are installed on your Jenkins instance.
Below is the Pipeline stage that invokes the docker
agent with the following configuration:
image
instructs to pull the Qodana Docker image, andqodana-<linter>
here specifies the required Qodana linter.args
provide arguments for binding the project root and report directories to the Qodana image.
stage('Qodana') {
agent {
docker {
args '''
-v /opt/qodana/reports:/data/reports
-v /opt/qodana/cache:/data/cache
-v /opt/qodana/results:/data/results
-v /opt/qodana/qodana.sarif.json:/data/qodana.sarif.json
--entrypoint=""
'''
image 'jetbrains/qodana-<linter>'
}
}
steps {
sh "qodana --save-report"
}
}
Last modified: 21 November 2022