As an alternative to the Black Duck Security Scan Plugin for Jenkins, the Bridge CLI can be downloaded and directly executed in a Jenkins pipeline. It has all the functionality of the plugin, but requires an additional step to download the Bridge CLI.
To discover more about the Black Duck Security Scan Plugin for Jenkins and what it can do, take a look at the overview page.
Prerequisites
- The following reading is recommended before starting this quickstart:
- The Branch Source plugin must be installed for the appropriate platform to enable Jenkins to integrate with a source code repository.
- For security reasons, it is advisable to use Jenkins credentials to store sensitive information.
- Add the following credentials in Jenkins ()
Credential ID Type Description Example srm-apikeySecret text SRM API Key YOUR_TOKEN - Ensure the following environment variables are set correctly in the pipeline:
Variable Type Description Example BRIDGE_SRM_SERVERURLVariable SRM server URL https://srm.server.blackduck.comBRIDGECLI_LINUX64Variable Bridge CLI download URL for Linux https://repo.blackduck.com/artifactory/bds-integrations-release/com/blackduck/integration/bridge/binaries/bridge-cli-bundle/latest/bridge-cli-bundle-linux64.zip
- The instructions below use the Bridge
COVERITY_BUILD_COMMANDandCOVERITY_CLEAN_COMMANDenvironment variables to specify the build and clean commands. - See Using Bridge with compiled languages and the Coverity section in Client scan tool parameters for an overview of the various methods available for configuring Bridge CLI to integrate with Coverity to capture and analyze the build for compiled languages.
Instructions
Troubleshooting and support
If a pipeline error is encountered similar to the example below, then it is likely that the BRIDGE_SRM_BRANCH_PARENT environment variable has not been set correctly.
When scanning new non-default branches, e.g. develop, stage or release, the BRIDGE_SRM_BRANCH_PARENT environment variable must be set to the name of the default branch, e.g. main. An example is shown in the Quickstart code example in the Instructions section.
For further troubleshooting, check the archived artifacts that include detailed logs from the .bridge folder.