The Atlas Scanner utility is used to send the analysis results to the server. It is distributed as a ready-to-use Docker image:
pull viva64/atlas-scanner
By default, this downloads the latest stable version of the utility. To download a specific version, use the Docker tagging system:
pull viva64/atlas-scanner:8.0
It is recommended that all PVS-Studio Atlas services be kept on the same version.
Before running the scanner, enter the PVS-Studio license on the server and obtain the following two values, which can be found in the server settings:
For more information on these settings, see the Project and branch management documentation page.
To obtain the values, enter the following command:
docker run --rm viva64/atlas-scanner --help
The minimal command to run the scanner might look like this:
docker run --rm -v "/Users/nickname/Downloads/BotSharp":"/mnt/project" viva64/atlas-scanner --reportPaths /mnt/project/BotSharp.json --sourceTreeRoot /mnt/project/ --serverUrl http://atlas-server:8080 --apiKey 49931204-56e0-4cbf-b87a-29c94735cc9e --branchId 85c6129f-0097-466a-9e48-466a7b74d75f --logDir /mnt/project/scanner_logs
To get started quickly, replace the text in bold with your own values.
If Atlas Server and Atlas Scanner are running on the same machine, the analysis results must be sent to http://host.docker.internal:8080.
Docker command-line arguments used:
run (required) — creates and starts a new container based on the specified image.-v (required) — mounts the project directory to the Docker container so that Atlas Scanner inside the container can process the scanner report and the source files.--rm — instructs Docker to remove the container after it has finished running.Key command-line arguments for Atlas Scanner:
--version — displays information about the current version. --help — displays help information with all command-line arguments in the console.--reportPaths (required) — paths to analyzer reports in .plog, .json, and .sarif formats. Multiple paths can be listed if reports from different code analyzers need to be uploaded to a single project branch.--sourceTreeRoot (required) — the path to the project directory containing the source code files.--serverUrl (required) — the address where the Atlas Server receiving the results is deployed.--apiKey (required) — an authorization key that allows Atlas Scanner to connect. API keys are created in the Atlas Server settings by users with Administrator access.--branchId (required) — the branch ID in the project where the analysis results should be uploaded.--logDir — the directory containing Atlas Scanner logs. Analyzer logs and reports are not included in the stored data.--sourceMask — the mask used to package source code files and send them to the server. Default value: .c.cpp.hpp.h.cc.cxx.cs.csx.razor.java.ts.js.go.--uploadMode — specifies the mode for handling source code files: ReportSources (by default) packages only those source code files specified in the analyzer report. Ignores the sourceMask argument. MaskSources — packages all source files matching the mask specified in the sourceMask argument, as well as the files specified in the analyzer report.WithoutSources — source code files are not sent to the server.--quietMode — a mode that suppresses console output. When used with the logDir argument, all output is saved to a separate file instead.Description of the exit codes for the utility:
.plog format;.json format;.sarif format;.pvsmap report before sending it;.pvsmap report to the server.