For the complete documentation index, see llms.txt. This page is also available as Markdown.

Pipeline Examples

These are the pipeline steps that Administration → Setup → Scan in your CI/CD pipeline generates. In the app, the drawer fills in your server address and the current scanner version; here they show https://izsuite.example.com and version 26.4.1.

Requires the Code Analysis licence.

Scan in your CI/CD pipeline drawer showing the generated GitHub Actions workflow
The GitHub Actions step in Setup

Before you add a step

  1. Create a token with the Pipeline scanner role and store it as a masked secret named IZ_ACCESS_TOKEN (in Jenkins, a Secret text credential with the ID iz-access-token). See Pipeline Access Tokens.

  2. Choose the application key. The Bitbucket, GitHub and GitLab steps use the repository name; replace it if you want another key.

  3. Decide whether a failed quality gate fails the build. In Setup, Fail the build when the quality gate fails adds the last line (grep ...) or, for Maven, -DabortOnQualityGateFailure=true. It is on by default.

Steps per platform

Every step except Maven downloads the Linux scanner, runs it with its output in iz-scan.log, prints the log, and fails the step unless the log has QUALITY GATE STATUS:: PASSED. Checking the log also catches a scan that stopped with an error; -abortOnQualityGateFailure true is the alternative. See Break the Build on a Quality Gate.

Runs on every push, on the pushed branch.

With Scan pull requests instead of branches turned on, Setup writes a pull-requests pipeline instead:

Runs on pushes and pull requests. A pull request is scanned as a pull request, a push as a branch. The step also writes a SARIF report and uploads it to GitHub code scanning; when code scanning is not available, the upload fails but the job does not.

A merge request pipeline is scanned as a pull request, any other pipeline as a branch. The log is kept as a job artifact.

In a multibranch pipeline, a change request (CHANGE_ID) is scanned as a pull request, anything else as its branch. Replace <application-key> with your key.

Add this command to a pipeline step, with iz-settings.xml next to pom.xml. BRANCH is your CI/CD platform's branch-name variable.

The Maven goal fails the build by itself on a failed quality gate. See Maven Plugin.

Judge pull requests on new code

The pull request steps above pass -pullRequestId only. IZ Suite then has no target branch to compare with, so the pull request is judged on all its findings, like a branch. To judge it on the code it changes, add -pullRequestTargetBranch with the branch it merges into, next to -pullRequestId:

Platform
Add to the scanner command

Bitbucket Pipelines

-pullRequestTargetBranch "$BITBUCKET_PR_DESTINATION_BRANCH"

GitHub Actions

-pullRequestTargetBranch "$GITHUB_BASE_REF"

GitLab CI

-pullRequestTargetBranch "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"

Jenkins (multibranch)

-pullRequestTargetBranch "$CHANGE_TARGET"

For GitHub Actions, GitLab CI and Jenkins, put it inside the pull request branch of the if, for example in GitHub Actions:

The target branch must have been scanned under the same application key. See Pull Request Analysis.

Other CI/CD platforms

Any platform that can run a shell step works the same way: download the zip for the build machine's operating system, run the scanner with the options in Command-Line Scanner, and check the log for QUALITY GATE STATUS:: PASSED.

Next steps

Last updated

Was this helpful?