This quickstart explains how to set up a Jenkins multibranch pipeline for a Black Duck® SCA project that will run a full scan and Pull Request scan. Pull Request review comments are only created for new issues created that are detected on the feature branch but not the target branch.
The full scan will be triggered by push and merge events on specified branches. Conversely, the Pull Request scan will be triggered by push events to Pull Requests that target those branches. Any new security issues introduced by a Pull Request will be added as review comments on the Pull Request.
Prerequisites
- The following reading is recommended before starting the quickstart:
- Install the Black Duck Security Scan plugin to integrate with a Black Duck® SCA server instance.
- Install and configure the appropriate Branch Source plugin to enable Jenkins to integrate with a source code repository and validate Pull Request events.
- Configure a source code management token to enable the Black Duck Security Scan plugin to inject Pull Request review comments for new security issues uncovered during a Pull Request scan.
- Access to a Jenkins Multibranch Pipeline project.
- Important:
Please note that the following Black Duck Security Scan Plugin parameters are required to run a Pull Request scan and inject review comments. These are included in this quickstart example and listed in the table below. A Pull Request scan will not run if these parameters and quickstart prerequisites are not configured. This includes providing a source code management token to allow review comments to be added by the plugin.
Parameter Description Example DETECT_ARGSEnables the plugin to identify the appropriate Black Duck® SCA project and version. For Pull Request scans, the project version is set to the parent branch of the Pull Request, allowing for an accurate comparison of changes. --detect.project.name='${env.DETECT_PROJECT_NAME}' --detect.project.version.name=${version}blackducksca_prComment_enabledWhen true, this enables Pull Request comments."true"Note: Note: The Black Duck Security Scan Plugin integrates with Black Duck® SCA via Bridge CLI. Additional scan configuration options not available through the template's parameter set can be specified by defining relevant Bridge CLI environment variables within the pipeline job.