BitBucket
On this page
Follow the step-by-step instructions below to set up the Radar CLI in your Bitbucket pipeline.
Prerequisites
Before configuring your Bitbucket pipeline, ensure you have:
Required
- Credential Token: Created in Credentials
- You'll need this for the
EUREKA_AGENT_TOKENvariable
- You'll need this for the
Optional
- Any scanner API credential/token for scanners that require them
Step by step instructions
Log in to Bitbucket and select the atlassian BitBucket app.
Navigate to the desired workspace and select the repository to integrate the Radar CLI with.
Navigate to Repository Settings → Repository variables in the left sidebar.
View and add the following variables below for your repository:
Required Variables
Add the following credentials created in the prerequisites:
Variable Name Value Description EUREKA_AGENT_TOKENYour token Authentication token for uploading scan results to Eureka Optional Scanner Variables
See below for optional variables associated with scanners you may be using:
Veracode
Variable Name Value Description SRCCLR_API_TOKENYour SCA token Veracode Source Clear (SCA) API token VERACODE_API_KEY_IDYour API key ID Veracode Static Analysis API key ID VERACODE_API_KEY_SECRETYour API secret Veracode Static Analysis API key secret 💡 Click the Secured checkbox to keep sensitive variables secure.
After successfully adding the repository variables:
- If you do not have an existing Bitbucket pipeline yaml, create a new
bitbucket-pipelines.ymlfile in the root of your repository of the branch that you want the Radar CLI to scan and open it. - If you have an existing
bitbucket-pipelines.yml, open it.
- If you do not have an existing Bitbucket pipeline yaml, create a new
Add the following code to your new or existing
bitbucket-pipelines.ymlfile:# Run Radar CLI scan via Bitbucket Pipelines image: node:22 pipelines: branches: main: - step: name: Run Radar Scan services: - docker script: - npm i @eurekadevsecops/radar - npx radar scanCommit the changes to your
bitbucket-pipelines.ymlfile to your repository. The Radar CLI should now be apart of your new or existing pipeline.Navigate to Pipelines in the left sidebar.
Select Run Pipeline.
Select the branch and pipeline that corresponds to the
bitbucket-pipeline.ymlchanges that were previously made.Select Run to start the pipeline job. The Radar CLI should now start running a scan for your repository. Once the job is completed, check the Eureka Web Application for your scan results.