The CodeQL Plugin automatically installs and sets up the CodeQL CLI on a Jenkins agent during a build.
During a build this plugin will:
- Install a specific version of the CodeQL CLI
- Add the following environment variables:
PATH
: The CodeQL CLI home will be added to thePATH
variable so that the tool will be available during buildCODEQL_CLI_HOME
: A new environment variable will be added containing the home of the CODEQL_CLI
- In the Jenkins global tool configuration settings (Manage Jenkins → Global Tool Configuration), find the "CodeQL" section, click "CodeQL Installations…" and "Add CodeQL".
- Enter a name, e.g. "CodeQL 2.5.5": This will be the name entered in the Pipeline
- Select "Install automatically" and select the desired CodeQL version from the drop-down list
For pipelines, you can use the tool
step or the withCodeQL
step as seen below:
node {
stage('Build') {
withCodeQL(codeql: 'CodeQL 2.5.5') {
sh 'codeql --version'
}
}
}
Refer to our contribution guidelines
Licensed under MIT, see LICENSE