As noted in Scan workflows, to perform a scan, you can initiate the scan at
the command line (CLI) by issuing either a single coverity scan command
or by issuing the series of commands coverity capture, coverity
analyze, and coverity commit to perform the scan steps one
at a time. Also, for CI/CD, you can develop scripts to run scans. These scripts can
include the command line parameters that define the scan.
You can create a configuration file, coverity.yaml or
coverity.json, to provide command options to coverity commands,
thereby simplifying the command that you issue at the command prompt. Parameters
specified in the command line override parameters defined in a configuration file.
Coverity cloud scan parameters
To run scans in Kubernetes containers in the cloud, you use a number of parameters that direct
the scans to cloud-based containers, as well as other required or optional
parameters to manage performance, etc. You can configure these parameters either at
a command line or in the coverity.yaml configuration file. When
designing a CI/CD pipeline, you can provide these parameters within scripts to run
and configure scans in the cloud.. This enables you to perform scans without needing
to create a configuration file.
coverity
setup or coverity scan commands. To work around this
issue, run coverity setup using the Windows command shell
cmd.exe. You can then switch back to the Cygwin shell.You can specify the following Coverity cloud parameters at either a command line or in the
coverity.yaml config file:
| Option | Description |
|---|---|
COVERITY_CLI_CONNECT_USERNAME and
COVERITY_CLI_CONNECT_PASSWORD |
Coverity Connect authentication: Specify the environment
variables COVERITY_CLI_CONNECT_USERNAME and
COVERITY_CLI_CONNECT_PASSWORD to authenticate
Coverity Connect. |
|
Connect URL: Specify the Connect URL. CLI example To to override the value set in the
To specify the Connect URL in the
|
|
Stream name: Specify the stream name. CLI example To to override the value set in the
To specify the stream name in the
|
|
Optional: Analysis location analyze.location specifies the scan (analysis) location:
CLI example To set the CLI command to override the value set in the
To configure the
|
|
Optional: pool (container) size
CLI example To specify the analysis pool size in the CLI command, add the option:
To specify the container size in the
To override the value set in the
|
Examples
These values can be set within the coverity.yaml config file. For
example:
COVERITY_CLI_CONNECT_USERNAME=<userName>
COVERITY_CLI_CONNECT_PASSWORD=<password>
commit.connect.url=https://connect.example.com:8443
commit.connect.stream=my-project
analyze.location=connect
analyze.pool-size=medium
The following example, uses the -o (override) option to override values in
the coverity.yaml file:
$ COVERITY_CLI_CONNECT_USERNAME=<userName> \
COVERITY_CLI_CONNECT_PASSWORD=<password> \
coverity scan -o commit.connect.url=https://connect.example.com:8443 \
-o commit.connect.stream=my-project \
-o analyze.location=connect \
-o analyze.pool-size=medium