Skip to main content

Code Repo - BitBucket Server

Setting up an access token

First you must create an access token with read permissions in your BitBucket instance.

  1. Once logged in, in your profile menu click Manage account.
  2. Go to the Access tokens tab and click Create token.
  3. Fill in the token name and ensure the permissions are set to Read.
  4. Click Create and copy the token for the next step.

Setting up BitBucket Server

  1. Go to your organization management page by clicking Manage organization found on your landscape page.
  2. Go to the Code repo integration tab.
  3. Click the BitBucket and then BitBucket Server buttons.
  4. Enter your BitBucket server URL which must be accessible to the IcePanel API (api.icepanel.io).
  5. Enter your BitBucket username and the token you created in the previous step.
  6. Click link.

Unlinking your BitBucket Server

You can unlink the integration from IcePanel and BitBucket Server.

  1. Go to your organization management page by clicking Manage organization found on your landscape page.
  2. Go to the Code repo integration tab and BitBucket Server tab.
  3. Click the Remove button.
  4. Once logged in, in your profile menu click Manage account.
  5. Go to the Access tokens tab and click Revoke next to the token you created in the previous steps.

CLI command rererence

Usage: IcePanel bitbucket-server-sync [options]

Syncronize IcePanel code repos with a BitBucket server instance

Options:
--api-url <value> IcePanel API URL (default: "https://api.icepanel.io/v1")
-k, --api-key <value> IcePanel API key
-s, --server-url <value> BitBucket server URL
-u, --username <value> BitBucket server username
-t, --token <value> BitBucket server token
-p, --project-key <value> BitBucket project key, comma seperated
-i, --interval <secs> Interval for syncronization (default: "1800")
-f, --force Force refresh of code repos and trees
--concurrency <value> Number of jobs that can be processed in parallel (default: "10")
-h, --help display help for command

Environment variables:
API_URL IcePanel API URL
API_KEY IcePanel API key
BITBUCKET_SERVER_URL BitBucket server URL
BITBUCKET_SERVER_USERNAME BitBucket server username
BITBUCKET_SERVER_TOKEN BitBucket server token
BITBUCKET_PROJECT_KEY BitBucket project key, comma seperated
SYNC_INTERVAL Interval for syncronization
CONCURRENCY Number of jobs that can be processed in parallel
LOG_LEVEL Options are fatal, error, warn, info, debug, trace, silent