Bitbucket
Frogbot integrates with Bitbucket through Bitbucket Pipelines. Both Bitbucket Cloud and Bitbucket Server (Data Center) are supported.
Bitbucket Pipelines (Bitbucket Cloud)
Step 1: Set Repository Variables
In your Bitbucket repository, go to Repository settings > Pipelines > Repository variables and add:
| Variable | Value | Secured |
|---|---|---|
JF_URL | Your JFrog Platform URL | No |
JF_ACCESS_TOKEN | JFrog Platform access token | Yes |
JF_GIT_TOKEN | Bitbucket Repository/Workspace/Project Access Token with repository write and pull request write permissions | Yes |
Step 2: Create the Pipeline Configuration
Add the following to your bitbucket-pipelines.yml:
image: releases-docker.jfrog.io/jfrog-ecosystem-integration-env
pipelines:
# Scan Repository - Runs on every push to the main branch
branches:
main:
- step:
name: "Frogbot scan-repository"
script:
- export JF_GIT_PROVIDER="bitbucketCloud"
- export JF_GIT_OWNER=$BITBUCKET_REPO_OWNER
- export JF_GIT_REPO=$BITBUCKET_REPO_SLUG
- export JF_GIT_BASE_BRANCH=$BITBUCKET_BRANCH
- curl -fLg "https://releases.jfrog.io/artifactory/frogbot/v3/[RELEASE]/getFrogbot.sh" | sh
- ./frogbot scan-repository
# Scan Repository - Trigger manually via Pipelines → Run pipeline → frogbot-scan-repository
custom:
frogbot-scan-repository:
- step:
name: "Frogbot scan-repository (manual)"
script:
- export JF_GIT_PROVIDER="bitbucketCloud"
- export JF_GIT_OWNER=$BITBUCKET_REPO_OWNER
- export JF_GIT_REPO=$BITBUCKET_REPO_SLUG
- export JF_GIT_BASE_BRANCH=$BITBUCKET_BRANCH
- curl -fLg "https://releases.jfrog.io/artifactory/frogbot/v3/[RELEASE]/getFrogbot.sh" | sh
- ./frogbot scan-repository
# Scan Pull Requests - Runs on every pull request
pull-requests:
'**':
- step:
name: "Frogbot scan-pull-request"
script:
- export JF_GIT_PROVIDER="bitbucketCloud"
- export JF_GIT_OWNER=$BITBUCKET_REPO_OWNER
- export JF_GIT_REPO=$BITBUCKET_REPO_SLUG
- export JF_GIT_BASE_BRANCH=$BITBUCKET_PR_DESTINATION_BRANCH
- export JF_GIT_PULL_REQUEST_ID=$BITBUCKET_PR_ID
- curl -fLg "https://releases.jfrog.io/artifactory/frogbot/v3/[RELEASE]/getFrogbot.sh" | sh
- ./frogbot scan-pull-requestReplace
mainunderbranches:with your default branch name if different.
Bitbucket Server / Data Center
For Bitbucket Server (self-hosted), use Jenkins as the CI runner and configure the Bitbucket webhook to trigger Jenkins pipelines. See Jenkins for detailed setup, using the Bitbucket Server webhook payload mappings.
Alternatively, run Frogbot from any CI system that supports Bitbucket Server webhooks by setting the environment variables listed below.
Bitbucket-Specific Variables
| Variable | Description |
|---|---|
JF_GIT_PROVIDER | Must be set to bitbucketServer |
JF_GIT_OWNER | Bitbucket workspace (Cloud) or project key (Server). Use $BITBUCKET_WORKSPACE in Pipelines |
JF_GIT_REPO | Repository slug (use $BITBUCKET_REPO_SLUG) |
JF_GIT_BASE_BRANCH | Target branch for PR scans ($BITBUCKET_PR_DESTINATION_BRANCH) or scanned branch for commit scans ($BITBUCKET_BRANCH) |
JF_GIT_PULL_REQUEST_ID | Pull request ID for PR scans ($BITBUCKET_PR_ID) |
JF_GIT_API_ENDPOINT | Required for Bitbucket Server. Set to your Bitbucket Server URL (e.g., https://bitbucket.mycompany.com) |
Git Token Permissions
The JF_GIT_TOKEN must be a Bitbucket Access Token (Cloud) or HTTP Access Token (Server) with the required repository and pull request permissions.
Bitbucket Cloud (Access Token)
Create a Repository, Workspace, or Project Access Token in Bitbucket with the following permissions:
repository:readrepository:writepullrequest:readpullrequest:write
You can create access tokens in one of the following locations:
- Repository Access Token — Repository settings → Security → Access tokens
- Workspace Access Token — Workspace settings → Security → Access tokens
- Project Access Token — Project settings → Access tokens
Bitbucket Server (HTTP Access Token):
- Project/Repository Write permission (to post PR comments and create auto-fix PRs)
Updated about 12 hours ago
