Bridge CLI parameters
| Input parameter | description |
|---|---|
bridgecli_install_directory |
Provide a path, where you want to install or have already installed Bridge CLI. If no path is provided, Bridge will use |
bridgecli_download_url |
Provide a URL to the storage location of your Bridge ZIP file. Bridge CLI will be automatically downloaded from there to |
bridgecli_download_version |
Specify the bridge version you want to download and configure. |
include_diagnostics |
When true the detailed Bridge logs appear in the console and Bridge diagnostics are uploaded in Jenkins Archive Artifact. |
mark_build_status |
Specify the build status if issues are present. Default value: Supported values: |
Proxy support
Here are two common methods for declaring proxy settings in Jenkins:
-
Utilize the
environmentblock in the Jenkinsfile.environment { HTTP_PROXY = 'http://proxyIP:proxyPort' } -
Employ the
exportkeyword.export HTTP_PROXY=http://proxyIP:proxyPort
Black Duck Security Scan Plugin supports the following environment variables.
| Name | Format | Example |
|---|---|---|
| HTTP_PROXY / http_proxy | http://user:password@proxyIP:proxyPort/ |
|
| HTTPS_PROXY / https_proxy | https://user:password@proxyIP:proxyPort/ |
|
| NO_PROXY / no_proxy | Comma separated list of URLs/addresses for which proxy is not used | no_proxy="cern.ch,some.domain:8001,192.168.1.57" |
-
Proxy with auth: Users need to pass a username and password for authentication.
Example: http://user:password@proxyIP:proxyPort/
-
Proxy with no auth: Users do not need to pass credentials for authentication.
Example: http://proxyIP:proxyPort/
If proxy configuration requires authentication and the agent needs to run behind the proxy, pass parameters with authentication data when connecting the agent to the controller.
Using Docker containers
This guide explains how to configure the Black Duck Security Scan Plugin in Jenkins pipelines that use Docker agents. When using Docker agents, it is essential to mount specific directories into the container to ensure the the plugin functions correctly.
Required environment variable: -e HOME=$HOME must be provided. The Bridge CLI needs this variable so it can download and execute the necessary tools in the default $HOME path.
-
Bridge CLI installation directory
- Default Path:
$HOME/bridge-cli-bundle - Custom Path: If you installed the Bridge CLI elsewhere (e.g.,
/opt/blackduck/bridge-cli-bundle), mount that path instead.
- Default Path:
- Black Duck configuration directory
- Path:
$HOME/.blackduck - This is where the CLI downloads and stores product specific files and tools.
- If you have pre-configured Detect or Coverity tools in a specific custom path on your host machine, make sure to mount that path into your pipeline to use those tools effectively.
- Path:
input.jsonpath- Path:
$JENKINS_HOME - This is where the plugin writes the
input.jsonfile used by the Bridge CLI.
- Path:
Refer to the Docker documentation for more information.
Jenkins pipeline configuration
Use the args field in the docker block to mount the required volumes.
pipeline {
agent {
docker {
...
args '-e HOME=$HOME -v $HOME/bridge-cli-bundle:$HOME/bridge-cli-bundle -v $HOME/.blackduck:$HOME/.blackduck -v $JENKINS_HOME:$JENKINS_HOME'
}
...
...
Example 2: Using custom Bridge CLI path
/opt/blackduck/bridge-cli-bundle), update the mount accordingly: pipeline {
agent {
docker {
...
args '-e HOME=$HOME -v /opt/blackduck/bridge-cli-bundle:/opt/blackduck/bridge-cli-bundle -v $HOME/.blackduck:$HOME/.blackduck -v $JENKINS_HOME:$JENKINS_HOME'
}
...
...
- Ensure that the Bridge CLI is executable within the container by mounting the Bridge CLI path.
- The mounted
$JENKINS_HOMEand$HOME/.blackduckpaths must be accessible and writable by the container user. - If you are using a Jenkins agent running on a remote node, ensure the paths are valid on that node.
- For using any custom path in the pipeline, make your to mount those custom paths.
- Docker agents are ephemeral and do not persist across builds.
- Jenkins does not treat Docker containers as separate nodes.
- Therefore, tools like the Bridge CLI must be installed and managed on the host, not inside the container.
- All required files and tools must be mounted into the container from the host system.
- Bridge CLI not found: Verify the mount path and ensure the CLI is installed and executable.
input.jsonnot found: Ensure$JENKINS_HOMEis correctly mounted and writable.- Permission denied errors (e.g.,
mkdir /.blackduck): EnsureHOMEis set correctly and$HOME/.blackduckis mounted and writable.