Class CortexCommandBuilder
java.lang.Object
org.jenkinsci.plugins.cortexcloud.scanner.CortexCommandBuilder
Builds the "cortexcli image scan ..." argument list.
This class is deliberately free of Jenkins APIs so the exact command line can
be unit-tested in isolation. The argument order and flags reflect the verified
Cortex CLI contract:
cortexcli image scan --archive --archive-format docker-archive \
--name <name> --output-format json [--docker-host <sock>] \
[--ci-pipeline-id <id>] [--ci-build-id <id>] [--timeout <s>] <target>
- --archive is required when the target is a tar archive.
- The target (tarball path or image reference) is always the last argument.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionarchive(boolean archive) archiveFormat(String archiveFormat) build()ciPipelineId(String ciPipelineId) dockerHost(String dockerHost) outputFormat(String outputFormat) Sets the scan source (maps to --source); scopes source-based tenant policies to CI scans.Sets the scan target - a tarball path (with archive(true)) or an image reference.timeoutSeconds(Integer timeoutSeconds) uploadMode(String uploadMode) Sets the upload mode (maps to --upload-mode); controls how much scan data is uploaded/retained.
-
Constructor Details
-
CortexCommandBuilder
-
-
Method Details
-
name
-
target
Sets the scan target - a tarball path (with archive(true)) or an image reference. -
archive
-
archiveFormat
-
outputFormat
-
dockerHost
-
ciPipelineId
-
ciBuildId
-
timeoutSeconds
-
source
Sets the scan source (maps to --source); scopes source-based tenant policies to CI scans. -
uploadMode
Sets the upload mode (maps to --upload-mode); controls how much scan data is uploaded/retained. -
build
- Returns:
- the full argument list, beginning with the CLI executable path and ending with the scan target.
- Throws:
IllegalStateException- if the target is not set.
-