Bitbucket (Self Hosted)
Port's Bitbucket Self Hosted (Server / Data Center) integration allows you to model Bitbucket Server / Bitbucket Data Center resources in your software catalog and ingest data into them. It is referred to as Bitbucket Server in Ocean.
This documentation covers Port's integration with Bitbucket (Self-Hosted). For information about integrating with Bitbucket Cloud, please refer to the Bitbucket Cloud integration documentation.
Overview
This integration allows you to:
- Map and organize your desired Bitbucket resources and their metadata in Port (see supported resources below).
- Watch for Bitbucket object changes (create/update/delete) in real-time, and automatically apply the changes to your software catalog.
Supported Resources
The resources that can be ingested from Bitbucket (Self-Hosted) into Port are listed below.
It is possible to reference any field that appears in the API responses linked below in the mapping configuration.
Setup
The Bitbucket (Self-Hosted) integration does not support GitOps yet. This capability is planned for a future release and is WIP. If you really need GitOps support, you can use the webhook gitops installation method.
When using the Real-Time (self-hosted) or Hosted by Port installation method, you should set the bitbucketIsVersion8Point7OrOlder
parameter to true
if you are using Bitbucket (Self-Hosted) version 8.7 or older. This is because webhook events are setup differently in Bitbucket (Self-Hosted) 8.8 and above.
Choose one of the following installation methods:
- Hosted by Port
- Real-Time (self-hosted)
- Scheduled (CI)
Using this installation option means that the integration will be hosted by Port, with a customizable resync interval to ingest data into Port.
Live event support
This integration supports live events, allowing real-time updates to your software catalog without waiting for the next scheduled sync.
Supported live event triggers
Pull Request:
- pr:modified
- pr:opened
- pr:merged
- pr:reviewer:updated
- pr:declined
- pr:deleted
- pr:comment:deleted
- pr:from_ref_updated
- pr:comment:edited
- pr:reviewer:unapproved
- pr:reviewer:needs_work
- pr:reviewer:approved
- pr:comment:added
Repository:
- repo:modified
- repo:refs_changed
Project:
- project:modified
Alternatively, you can install the integration using the Real-time (self-hosted) method to update Port in real time using webhooks.
Installation
To install, follow these steps:
-
Go to the Data sources page of your portal.
-
Click on the
+ Data source
button in the top-right corner. -
Click on the relevant integration in the list.
-
Under
Select your installation method
, chooseHosted by Port
. -
Configure the
integration settings
andapplication settings
as you wish (see below for details).
Application settings
Every integration hosted by Port has the following customizable application settings, which are configurable after installation:
-
Resync interval
: The frequency at which Port will ingest data from the integration. There are various options available, ranging from every 1 hour to once a day. -
Send raw data examples
: A boolean toggle (enabled
by default). If enabled, raw data examples will be sent from the integration to Port. These examples are used when testing your mapping configuration, they allow you to run yourjq
expressions against real data and see the results.
Integration settings
Every integration has its own tool-specific settings, under the Integration settings
section.
Each of these settings has an ⓘ icon next to it, which you can hover over to see a description of the setting.
Port secrets
Some integration settings require sensitive pieces of data, such as tokens.
For these settings, Port secrets will be used, ensuring that your sensitive data is encrypted and secure.
When filling in such a setting, its value will be obscured (shown as ••••••••
).
For each such setting, Port will automatically create a secret in your organization.
To see all secrets in your organization, follow these steps.
Limitations
- The maximum time for a full sync to run is based on the configured resync interval. For very large amounts of data where a resync operation is expected to take longer, please use a longer interval.
Port source IP addresses
When using this installation method, Port will make outbound calls to your 3rd-party applications from static IP addresses.
You may need to add these addresses to your allowlist, in order to allow Port to interact with the integrated service:
- Europe (EU)
- United States (US)
54.73.167.226
63.33.143.237
54.76.185.219
3.234.37.33
54.225.172.136
3.225.234.99
Using this installation option means that the integration will be able to update Port in real time using webhooks.
Prerequisites
To install the integration, you need a Kubernetes cluster that the integration's container chart will be deployed to.
Please make sure that you have kubectl
and helm
installed on your machine, and that your kubectl
CLI is connected to the Kubernetes cluster where you plan to install the integration.
If you are having trouble installing this integration, please refer to these troubleshooting steps.
For details about the available parameters for the installation, see the table below.
- Helm
- ArgoCD
To install the integration using Helm:
-
Go to the Bitbucket Self Hosted data source page in your portal.
-
Select the
Real-time and always on
method: -
A
helm
command will be displayed, with default values already filled out (e.g. your Port client ID, client secret, etc).
Copy the command, replace the placeholders with your values, then run it in your terminal to install the integration.
The port_region
, port.baseUrl
, portBaseUrl
, port_base_url
and OCEAN__PORT__BASE_URL
parameters are used to select which instance or Port API will be used.
Port exposes two API instances, one for the EU region of Port, and one for the US region of Port.
- If you use the EU region of Port (https://app.port.io), your API URL is
https://api.port.io
. - If you use the US region of Port (https://app.us.port.io), your API URL is
https://api.us.port.io
.
To install the integration using ArgoCD:
- Create a
values.yaml
file inargocd/my-ocean-bitbucket-server-integration
in your git repository with the content:
Remember to replace the placeholder for BITBUCKET_USERNAME
, BITBUCKET_PASSWORD
, BITBUCKET_BASE_URL
, BITBUCKET_WEBHOOK_SECRET
, BITBUCKET_IS_VERSION_8_POINT_7_OR_OLDER
.
initializePortResources: true
scheduledResyncInterval: 120
integration:
identifier: my-ocean-bitbucket-server-integration
type: bitbucket-server
eventListener:
type: POLLING
config:
bitbucketBaseUrl: BITBUCKET_BASE_URL
bitbucketUsername: BITBUCKET_USERNAME
bitbucketIsVersion8Point7OrOlder: BITBUCKET_IS_VERSION_8_POINT_7_OR_OLDER
secrets:
bitbucketPassword: BITBUCKET_PASSWORD
bitbucketWebhookSecret: BITBUCKET_WEBHOOK_SECRET
- Install the
my-ocean-bitbucket-server-integration
ArgoCD Application by creating the followingmy-ocean-bitbucket-server-integration.yaml
manifest:
Remember to replace the placeholders for YOUR_PORT_CLIENT_ID
YOUR_PORT_CLIENT_SECRET
and YOUR_GIT_REPO_URL
.
Multiple sources ArgoCD documentation can be found here.
ArgoCD Application
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: my-ocean-bitbucket-server-integration
namespace: argocd
spec:
destination:
namespace: my-ocean-bitbucket-server-integration
server: https://kubernetes.default.svc
project: default
sources:
- repoURL: 'https://port-labs.github.io/helm-charts/'
chart: port-ocean
targetRevision: 0.1.14
helm:
valueFiles:
- $values/argocd/my-ocean-bitbucket-server-integration/values.yaml
parameters:
- name: port.clientId
value: YOUR_PORT_CLIENT_ID
- name: port.clientSecret
value: YOUR_PORT_CLIENT_SECRET
- name: port.baseUrl
value: https://api.getport.io
- repoURL: YOUR_GIT_REPO_URL
targetRevision: main
ref: values
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
The port_region
, port.baseUrl
, portBaseUrl
, port_base_url
and OCEAN__PORT__BASE_URL
parameters are used to select which instance or Port API will be used.
Port exposes two API instances, one for the EU region of Port, and one for the US region of Port.
- If you use the EU region of Port (https://app.port.io), your API URL is
https://api.port.io
. - If you use the US region of Port (https://app.us.port.io), your API URL is
https://api.us.port.io
.
- Apply your application manifest with
kubectl
:
kubectl apply -f my-ocean-bitbucket-server-integration.yaml
This table summarizes the available parameters for the installation.
Parameter | Description | Required |
---|---|---|
port.clientId | Your port client id | ✅ |
port.clientSecret | Your port client secret | ✅ |
port.baseUrl | Your Port API URL - https://api.getport.io for EU, https://api.us.getport.io for US | ✅ |
integration.identifier | Change the identifier to describe your integration | ✅ |
integration.type | The integration type | ✅ |
integration.eventListener.type | The event listener type | ✅ |
integration.config.bitbucketUsername | Bitbucket username | |
integration.secrets.bitbucketPassword | Bitbucket password | |
integration.secrets.bitbucketWebhookSecret | Bitbucket webhook secret used to verify the webhook request | |
integration.config.bitbucketBaseUrl | Bitbucket base url | ✅ |
integration.config.bitbucketIsVersion8Point7OrOlder | Bitbucket is version 8.7 or older | ❌ |
scheduledResyncInterval | The number of minutes between each resync | ❌ |
initializePortResources | Default true, When set to true the integration will create default blueprints and the port App config Mapping | ❌ |
sendRawDataExamples | Enable sending raw data examples from the third party API to port for testing and managing the integration mapping. Default is true | ❌ |
baseUrl | The base url of the instance where the Bitbucket (Self-Hosted) integration is hosted, used for real-time updates. (e.g.https://mybitbucket-self-hosted-ocean-integration.com ) | ❌ |
For advanced configuration such as proxies or self-signed certificates, click here.
This workflow/pipeline will run the Bitbucket (Self-Hosted) integration once and then exit, this is useful for scheduled ingestion of data.
If you want the integration to update Port in real time using webhooks you should use the Real-time (self-hosted) installation option.
- GitHub
- Jenkins
- Azure Devops
- GitLab
Make sure to configure the following Github Secrets:
Parameter | Description | Example | Required |
---|---|---|---|
port_client_id | Your Port client (How to get the credentials) id | ✅ | |
port_client_secret | Your Port client (How to get the credentials) secret | ✅ | |
port_base_url | Your Port API URL - https://api.getport.io for EU, https://api.us.getport.io for US | ✅ | |
config -> bitbucket_username | Bitbucket username | ✅ | |
config -> bitbucket_password | Bitbucket password | ✅ | |
config -> bitbucket_base_url | Bitbucket base url | ✅ | |
config -> bitbucket_webhook_secret | Bitbucket webhook secret used to verify the webhook request | ❌ | |
config -> bitbucket_is_version_8_point_7_or_older | Bitbucket is version 8.7 or older | ❌ | |
initialize_port_resources | Default true, When set to true the integration will create default blueprints and the port App config Mapping. Read more about initializePortResources | ❌ | |
identifier | The identifier of the integration that will be installed | ❌ | |
version | The version of the integration that will be installed | latest | ❌ |
sendRawDataExamples | Enable sending raw data examples from the third party API to port for testing and managing the integration mapping. Default is true | true | |
baseUrl | The host of the Port Ocean app. Used to set up the integration endpoint as the target for webhooks created in Bitbucket Server | https://my-ocean-integration.com | ❌ |
The following example uses the Ocean Sail Github Action to run the Bitbucket (Self-Hosted) integration. For further information about the action, please visit the Ocean Sail Github Action
Here is an example for bitbucket-server-integration.yml
workflow file:
name: Bitbucket Server Exporter Workflow
on:
workflow_dispatch:
schedule:
- cron: '0 */1 * * *' # Determines the scheduled interval for this workflow. This example runs every hour.
jobs:
run-integration:
runs-on: ubuntu-latest
timeout-minutes: 30 # Set a time limit for the job
steps:
- uses: port-labs/ocean-sail@v1
with:
type: 'bitbucket-server'
port_client_id: ${{ secrets.OCEAN__PORT__CLIENT_ID }}
port_client_secret: ${{ secrets.OCEAN__PORT__CLIENT_SECRET }}
port_base_url: https://api.getport.io
config: |
bitbucket_username: ${{ secrets.OCEAN__INTEGRATION__CONFIG__BITBUCKET_USERNAME }}
bitbucket_password: ${{ secrets.OCEAN__INTEGRATION__CONFIG__BITBUCKET_PASSWORD }}
bitbucket_base_url: ${{ secrets.OCEAN__INTEGRATION__CONFIG__BITBUCKET_BASE_URL }}
bitbucket_webhook_secret: ${{ secrets.OCEAN__INTEGRATION__CONFIG__BITBUCKET_WEBHOOK_SECRET }}
bitbucket_is_version_8_point_7_or_older: ${{ secrets.OCEAN__INTEGRATION__CONFIG__BITBUCKET_IS_VERSION_8_POINT_7_OR_OLDER }}
Your Jenkins agent should be able to run docker commands.
Make sure to configure the following Jenkins Credentials of Secret Text
type:
Parameter | Description | Example | Required |
---|---|---|---|
OCEAN__INTEGRATION__CONFIG__BITBUCKET_USERNAME | Bitbucket Server username | ✅ | |
OCEAN__INTEGRATION__CONFIG__BITBUCKET_PASSWORD | Bitbucket Server password | ✅ | |
OCEAN__INTEGRATION__CONFIG__BITBUCKET_BASE_URL | Bitbucket Server base url | ✅ | |
OCEAN__INTEGRATION__CONFIG__BITBUCKET_WEBHOOK_SECRET | Bitbucket Server webhook secret used to verify the webhook request | ❌ | |
OCEAN__INTEGRATION__CONFIG__BITBUCKET_IS_VERSION_8_POINT_7_OR_OLDER | Bitbucket Server is version 8.7 or older | ❌ | |
OCEAN__PORT__CLIENT_ID | Your Port client (How to get the credentials) id | ✅ | |
OCEAN__PORT__CLIENT_SECRET | Your Port client (How to get the credentials) secret | ✅ | |
OCEAN__PORT__BASE_URL | Your Port API URL - https://api.getport.io for EU, https://api.us.getport.io for US | ✅ | |
OCEAN__INITIALIZE_PORT_RESOURCES | Default true, When set to true the integration will create default blueprints and the port App config Mapping. Read more about initializePortResources | ❌ | |
OCEAN__INTEGRATION__IDENTIFIER | The identifier of the integration that will be installed | ❌ | |
OCEAN__SEND_RAW_DATA_EXAMPLES | Enable sending raw data examples from the third party API to port for testing and managing the integration mapping. Default is true | ❌ | |
OCEAN__BASE_URL | The host of the Port Ocean app. Used to set up the integration endpoint as the target for webhooks created in Linear | ❌ |
Here is an example for Jenkinsfile
groovy pipeline file:
pipeline {
agent any
stages {
stage('Run Bitbucket Server Integration') {
steps {
script {
withCredentials([
string(credentialsId: 'OCEAN__INTEGRATION__CONFIG__BITBUCKET_USERNAME', variable: 'OCEAN__INTEGRATION__CONFIG__BITBUCKET_USERNAME'),
string(credentialsId: 'OCEAN__INTEGRATION__CONFIG__BITBUCKET_PASSWORD', variable: 'OCEAN__INTEGRATION__CONFIG__BITBUCKET_PASSWORD'),
string(credentialsId: 'OCEAN__INTEGRATION__CONFIG__BITBUCKET_BASE_URL', variable: 'OCEAN__INTEGRATION__CONFIG__BITBUCKET_BASE_URL'),
string(credentialsId: 'OCEAN__INTEGRATION__CONFIG__BITBUCKET_WEBHOOK_SECRET', variable: 'OCEAN__INTEGRATION__CONFIG__BITBUCKET_WEBHOOK_SECRET'),
string(credentialsId: 'OCEAN__INTEGRATION__CONFIG__BITBUCKET_IS_VERSION_8_POINT_7_OR_OLDER', variable: 'OCEAN__INTEGRATION__CONFIG__BITBUCKET_IS_VERSION_8_POINT_7_OR_OLDER'),
string(credentialsId: 'OCEAN__PORT__CLIENT_ID', variable: 'OCEAN__PORT__CLIENT_ID'),
string(credentialsId: 'OCEAN__PORT__CLIENT_SECRET', variable: 'OCEAN__PORT__CLIENT_SECRET'),
]) {
sh('''
#Set Docker image and run the container
integration_type="bitbucket-server"
version="latest"
image_name="ghcr.io/port-labs/port-ocean-${integration_type}:${version}"
docker run -i --rm --platform=linux/amd64 \
-e OCEAN__EVENT_LISTENER='{"type":"ONCE"}' \
-e OCEAN__INITIALIZE_PORT_RESOURCES=true \
-e OCEAN__SEND_RAW_DATA_EXAMPLES=true \
-e OCEAN__INTEGRATION__CONFIG__BITBUCKET_USERNAME=$OCEAN__INTEGRATION__CONFIG__BITBUCKET_USERNAME \
-e OCEAN__INTEGRATION__CONFIG__BITBUCKET_PASSWORD=$OCEAN__INTEGRATION__CONFIG__BITBUCKET_PASSWORD \
-e OCEAN__INTEGRATION__CONFIG__BITBUCKET_BASE_URL=$OCEAN__INTEGRATION__CONFIG__BITBUCKET_BASE_URL \
-e OCEAN__INTEGRATION__CONFIG__BITBUCKET_WEBHOOK_SECRET=$OCEAN__INTEGRATION__CONFIG__BITBUCKET_WEBHOOK_SECRET \
-e OCEAN__INTEGRATION__CONFIG__BITBUCKET_IS_VERSION_8_POINT_7_OR_OLDER=$OCEAN__INTEGRATION__CONFIG__BITBUCKET_IS_VERSION_8_POINT_7_OR_OLDER \
-e OCEAN__PORT__CLIENT_ID=$OCEAN__PORT__CLIENT_ID \
-e OCEAN__PORT__CLIENT_SECRET=$OCEAN__PORT__CLIENT_SECRET \
-e OCEAN__PORT__BASE_URL='https://api.getport.io' \
$image_name
exit $?
''')
}
}
}
}
}
}
Your Azure Devops agent should be able to run docker commands. Learn more about agents here.
Variable groups store values and secrets you'll use in your pipelines across your project. Learn more
Setting Up Your Credentials
- Create a Variable Group: Name it port-ocean-credentials.
- Store the required variables (see the table below).
- Authorize Your Pipeline:
- Go to "Library" -> "Variable groups."
- Find port-ocean-credentials and click on it.
- Select "Pipeline Permissions" and add your pipeline to the authorized list.

Parameter | Description | Example | Required |
---|---|---|---|
OCEAN__INTEGRATION__CONFIG__BITBUCKET_USERNAME | Bitbucket Server username | ✅ | |
OCEAN__INTEGRATION__CONFIG__BITBUCKET_PASSWORD | Bitbucket Server password | ✅ | |
OCEAN__INTEGRATION__CONFIG__BITBUCKET_BASE_URL | Bitbucket Server base url | ✅ | |
OCEAN__INTEGRATION__CONFIG__BITBUCKET_WEBHOOK_SECRET | Bitbucket Server webhook secret used to verify the webhook request | ❌ | |
OCEAN__INTEGRATION__CONFIG__BITBUCKET_IS_VERSION_8_POINT_7_OR_OLDER | Bitbucket Server is version 8.7 or older | ❌ | |
OCEAN__PORT__CLIENT_ID | Your Port client (How to get the credentials) id | ✅ | |
OCEAN__PORT__CLIENT_SECRET | Your Port client (How to get the credentials) secret | ✅ | |
OCEAN__PORT__BASE_URL | Your Port API URL - https://api.getport.io for EU, https://api.us.getport.io for US | ✅ | |
OCEAN__INITIALIZE_PORT_RESOURCES | Default true, When set to true the integration will create default blueprints and the port App config Mapping. Read more about initializePortResources | ❌ | |
OCEAN__INTEGRATION__IDENTIFIER | The identifier of the integration that will be installed | ❌ | |
OCEAN__SEND_RAW_DATA_EXAMPLES | Enable sending raw data examples from the third party API to port for testing and managing the integration mapping. Default is true | ❌ | |
OCEAN__BASE_URL | The host of the Port Ocean app. Used to set up the integration endpoint as the target for webhooks created in Linear | ❌ |
Here is an example for bitbucket-server-integration.yml
pipeline file:
trigger:
- main
pool:
vmImage: "ubuntu-latest"
variables:
- group: port-ocean-credentials
steps:
- script: |
# Set Docker image and run the container
integration_type="bitbucket-server"
version="latest"
image_name="ghcr.io/port-labs/port-ocean-$integration_type:$version"
docker run -i --rm \
-e OCEAN__EVENT_LISTENER='{"type":"ONCE"}' \
-e OCEAN__INITIALIZE_PORT_RESOURCES=true \
-e OCEAN__SEND_RAW_DATA_EXAMPLES=true \
-e OCEAN__INTEGRATION__CONFIG__BITBUCKET_USERNAME=$(OCEAN__INTEGRATION__CONFIG__BITBUCKET_USERNAME) \
-e OCEAN__INTEGRATION__CONFIG__BITBUCKET_PASSWORD=$(OCEAN__INTEGRATION__CONFIG__BITBUCKET_PASSWORD) \
-e OCEAN__INTEGRATION__CONFIG__BITBUCKET_BASE_URL=$(OCEAN__INTEGRATION__CONFIG__BITBUCKET_BASE_URL) \
-e OCEAN__INTEGRATION__CONFIG__BITBUCKET_WEBHOOK_SECRET=$(OCEAN__INTEGRATION__CONFIG__BITBUCKET_WEBHOOK_SECRET) \
-e OCEAN__INTEGRATION__CONFIG__BITBUCKET_IS_VERSION_8_POINT_7_OR_OLDER=$(OCEAN__INTEGRATION__CONFIG__BITBUCKET_IS_VERSION_8_POINT_7_OR_OLDER) \
-e OCEAN__PORT__CLIENT_ID=$(OCEAN__PORT__CLIENT_ID) \
-e OCEAN__PORT__CLIENT_SECRET=$(OCEAN__PORT__CLIENT_SECRET) \
-e OCEAN__PORT__BASE_URL='https://api.getport.io' \
$image_name
exit $?
displayName: "Ingest Data into Port"
Make sure to configure the following GitLab variables:
Parameter | Description | Example | Required |
---|---|---|---|
OCEAN__INTEGRATION__CONFIG__BITBUCKET_USERNAME | Bitbucket Server username | ✅ | |
OCEAN__INTEGRATION__CONFIG__BITBUCKET_PASSWORD | Bitbucket Server password | ✅ | |
OCEAN__INTEGRATION__CONFIG__BITBUCKET_BASE_URL | Bitbucket Server base url | ✅ | |
OCEAN__INTEGRATION__CONFIG__BITBUCKET_WEBHOOK_SECRET | Bitbucket Server webhook secret used to verify the webhook request | ❌ | |
OCEAN__INTEGRATION__CONFIG__BITBUCKET_IS_VERSION_8_POINT_7_OR_OLDER | Bitbucket Server is version 8.7 or older | ❌ | |
OCEAN__PORT__CLIENT_ID | Your Port client (How to get the credentials) id | ✅ | |
OCEAN__PORT__CLIENT_SECRET | Your Port client (How to get the credentials) secret | ✅ | |
OCEAN__PORT__BASE_URL | Your Port API URL - https://api.getport.io for EU, https://api.us.getport.io for US | ✅ | |
OCEAN__INITIALIZE_PORT_RESOURCES | Default true, When set to true the integration will create default blueprints and the port App config Mapping. Read more about initializePortResources | ❌ | |
OCEAN__INTEGRATION__IDENTIFIER | The identifier of the integration that will be installed | ❌ | |
OCEAN__SEND_RAW_DATA_EXAMPLES | Enable sending raw data examples from the third party API to port for testing and managing the integration mapping. Default is true | ❌ | |
OCEAN__BASE_URL | The host of the Port Ocean app. Used to set up the integration endpoint as the target for webhooks created in Linear | ❌ |
Here is an example for .gitlab-ci.yml
pipeline file:
default:
image: docker:24.0.5
services:
- docker:24.0.5-dind
before_script:
- docker info
variables:
INTEGRATION_TYPE: bitbucket-server
VERSION: latest
stages:
- ingest
ingest_data:
stage: ingest
variables:
IMAGE_NAME: ghcr.io/port-labs/port-ocean-$INTEGRATION_TYPE:$VERSION
script:
- |
docker run -i --rm --platform=linux/amd64 \
-e OCEAN__EVENT_LISTENER='{"type":"ONCE"}' \
-e OCEAN__INITIALIZE_PORT_RESOURCES=true \
-e OCEAN__SEND_RAW_DATA_EXAMPLES=true \
-e OCEAN__INTEGRATION__CONFIG__BITBUCKET_USERNAME=$OCEAN__INTEGRATION__CONFIG__BITBUCKET_USERNAME \
-e OCEAN__INTEGRATION__CONFIG__BITBUCKET_PASSWORD=$OCEAN__INTEGRATION__CONFIG__BITBUCKET_PASSWORD \
-e OCEAN__INTEGRATION__CONFIG__BITBUCKET_BASE_URL=$OCEAN__INTEGRATION__CONFIG__BITBUCKET_BASE_URL \
-e OCEAN__INTEGRATION__CONFIG__BITBUCKET_WEBHOOK_SECRET=$OCEAN__INTEGRATION__CONFIG__BITBUCKET_WEBHOOK_SECRET \
-e OCEAN__INTEGRATION__CONFIG__BITBUCKET_IS_VERSION_8_POINT_7_OR_OLDER=$OCEAN__INTEGRATION__CONFIG__BITBUCKET_IS_VERSION_8_POINT_7_OR_OLDER \
-e OCEAN__PORT__CLIENT_ID=$OCEAN__PORT__CLIENT_ID \
-e OCEAN__PORT__CLIENT_SECRET=$OCEAN__PORT__CLIENT_SECRET \
-e OCEAN__PORT__BASE_URL='https://api.getport.io' \
$IMAGE_NAME
rules: # Run only when changes are made to the main branch
- if: '$CI_COMMIT_BRANCH == "main"'
The port_region
, port.baseUrl
, portBaseUrl
, port_base_url
and OCEAN__PORT__BASE_URL
parameters are used to select which instance or Port API will be used.
Port exposes two API instances, one for the EU region of Port, and one for the US region of Port.
- If you use the EU region of Port (https://app.port.io), your API URL is
https://api.port.io
. - If you use the US region of Port (https://app.us.port.io), your API URL is
https://api.us.port.io
.
For advanced configuration such as proxies or self-signed certificates, click here.
Configuration
Port integrations use a YAML mapping block to ingest data from the third-party api into Port.
The mapping makes use of the JQ JSON processor to select, modify, concatenate, transform and perform other operations on existing fields and values from the integration API.
Examples
To view and test the integration's mapping against examples of the third-party API responses, use the jq playground in your data sources page. Find the integration in the list of data sources and click on it to open the playground.
Additional examples of blueprints and the relevant integration configurations:
Project
Project blueprint
{
"identifier": "bitbucketProject",
"description": "A software catalog to represent Bitbucket project",
"title": "Bitbucket Project",
"icon": "BitBucket",
"schema": {
"properties": {
"public": {
"icon": "DefaultProperty",
"title": "Public",
"type": "boolean"
},
"description": {
"title": "Description",
"type": "string",
"icon": "DefaultProperty"
},
"type": {
"icon": "DefaultProperty",
"title": "Type",
"type": "string"
},
"link": {
"title": "Link",
"icon": "DefaultProperty",
"type": "string"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"relations": {}
}
Integration configuration
createMissingRelatedEntities: true
deleteDependentEntities: true
resources:
- kind: project
selector:
query: "true"
port:
entity:
mappings:
identifier: .key
title: .name
blueprint: '"bitbucketProject"'
properties:
public: .public
type: .type
description: .description
link: .links.self[0].href
Repository
Repository blueprint
{
"identifier": "bitbucketRepository",
"description": "A software catalog to represent Bitbucket repositories",
"title": "Bitbucket Repository",
"icon": "BitBucket",
"schema": {
"properties": {
"forkable": {
"icon": "DefaultProperty",
"title": "Is Forkable",
"type": "boolean"
},
"description": {
"title": "Description",
"type": "string",
"icon": "DefaultProperty"
},
"public": {
"icon": "DefaultProperty",
"title": "Is Public",
"type": "boolean"
},
"state": {
"icon": "DefaultProperty",
"title": "State",
"type": "string"
},
"link": {
"title": "Link",
"icon": "DefaultProperty",
"type": "string"
},
"documentation": {
"icon": "DefaultProperty",
"title": "Documentation",
"type": "string",
"format": "markdown"
},
"swagger_url": {
"title": "Swagger URL",
"type": "string",
"format": "url",
"spec": "async-api",
"icon": "DefaultProperty"
},
"readme": {
"title": "Readme",
"type": "string",
"format": "markdown",
"icon": "DefaultProperty"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"aggregationProperties": {},
"relations": {
"latestCommitAuthor": {
"title": "Latest Commit By",
"description": "The user that made the most recent commit to the base branch",
"target": "bitbucketUser",
"required": false,
"many": false
},
"project": {
"title": "Project",
"target": "bitbucketProject",
"required": false,
"many": false
}
}
}
Integration configuration
createMissingRelatedEntities: true
deleteDependentEntities: true
resources:
- kind: repository
selector:
query: "true"
port:
entity:
mappings:
identifier: .slug
title: .name
blueprint: '"bitbucketRepository"'
properties:
description: .description
state: .state
forkable: .forkable
public: .public
link: .links.self[0].href
documentation: .__readme
relations:
project: .project.key
latestCommitAuthor: .__latestCommit.author.emailAddress
Pull Request
Pull Request blueprint
{
"identifier": "bitbucketPullRequest",
"description": "A software catalog to represent Bitbucket pull requests",
"title": "Bitbucket Pull Request",
"icon": "BitBucket",
"schema": {
"properties": {
"created_on": {
"title": "Created On",
"type": "string",
"format": "date-time",
"icon": "DefaultProperty"
},
"updated_on": {
"title": "Updated On",
"type": "string",
"format": "date-time",
"icon": "DefaultProperty"
},
"description": {
"title": "Description",
"type": "string",
"icon": "DefaultProperty"
},
"state": {
"icon": "DefaultProperty",
"title": "State",
"type": "string",
"enum": [
"OPEN",
"MERGED",
"DECLINED",
"SUPERSEDED"
],
"enumColors": {
"OPEN": "yellow",
"MERGED": "green",
"DECLINED": "red",
"SUPERSEDED": "purple"
}
},
"owner": {
"title": "Owner",
"type": "string",
"icon": "DefaultProperty"
},
"link": {
"title": "Link",
"icon": "DefaultProperty",
"type": "string"
},
"destination": {
"title": "Destination Branch",
"type": "string",
"icon": "DefaultProperty"
},
"source": {
"title": "Source Branch",
"type": "string",
"icon": "DefaultProperty"
},
"reviewers": {
"items": {
"type": "string"
},
"title": "Reviewers",
"type": "array",
"icon": "DefaultProperty"
},
"merge_commit": {
"title": "Merge Commit",
"type": "string",
"icon": "DefaultProperty"
},
"mergedAt": {
"title": "Merged At",
"type": "string",
"format": "date-time",
"icon": "DefaultProperty"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"aggregationProperties": {},
"relations": {
"participants": {
"title": "Participants",
"description": "Users that contributed to the PR",
"target": "bitbucketUser",
"required": false,
"many": true
},
"repository": {
"title": "Repository",
"target": "bitbucketRepository",
"required": false,
"many": false
}
}
}
Integration configuration
createMissingRelatedEntities: true
deleteDependentEntities: true
resources:
- kind: pull-request
selector:
query: "true"
port:
entity:
mappings:
identifier: .id | tostring
title: .title
blueprint: '"bitbucketPullRequest"'
properties:
created_on: .createdDate | (tonumber / 1000 | strftime("%Y-%m-%dT%H:%M:%SZ"))
updated_on: .updatedDate | (tonumber / 1000 | strftime("%Y-%m-%dT%H:%M:%SZ"))
merge_commit: .fromRef.latestCommit
state: .state
owner: .author.user.emailAddress
link: .links.self[0].href
destination: .toRef.displayId
source: .fromRef.displayId
mergedAt: .closedDate as $d | if $d == null then null else ($d / 1000 | strftime("%Y-%m-%dT%H:%M:%SZ")) end
reviewers: "[.reviewers[].user.emailAddress]"
relations:
repository: .toRef.repository.slug
participants: "[.participants[].user.emailAddress]"
User
User blueprint
{
"identifier": "bitbucketUser",
"description": "A software catalog to represent Bitbucket users",
"title": "Bitbucket User",
"icon": "BitBucket",
"schema": {
"properties": {
"username": {
"type": "string",
"title": "Username",
"description": "The username of the user"
},
"url": {
"title": "URL",
"description": "The link to the user profile",
"icon": "BitBucket",
"type": "string"
},
"portUser": {
"title": "Port User",
"type": "string",
"icon": "DefaultProperty",
"format": "user"
}
},
"required": [
"username"
]
},
"mirrorProperties": {},
"calculationProperties": {},
"aggregationProperties": {},
"relations": {}
}
Integration configuration
createMissingRelatedEntities: true
deleteDependentEntities: true
resources:
- kind: user
selector:
query: "true"
port:
entity:
mappings:
identifier: .emailAddress
title: .displayName
blueprint: '"bitbucketUser"'
properties:
username: .name
url: .links.self[0].href
portUser: .emailAddress
Let's Test It
This section includes sample response data from Bitbucket Server. In addition, it includes the entity created from the resync event based on the Ocean configuration provided in the previous section.
Payload
Here is an example of the payload structure from Bitbucket Server:
Project response data
{
"key": "PROJ",
"id": 1,
"name": "Project",
"public": false,
"type": "NORMAL",
"links": {
"self": [
{
"href": "http://localhost:7990/projects/PROJ"
}
]
}
}
Repository response data
{
"slug": "repostiroy-3",
"id": 3,
"name": "Repostiroy-3",
"hierarchyId": "0a8dadb07bb606236d8c",
"scmId": "git",
"state": "AVAILABLE",
"statusMessage": "Available",
"forkable": true,
"project": {
"key": "PRO3",
"id": 3,
"name": "Project Three",
"public": false,
"type": "NORMAL",
"links": {
"self": [
{
"href": "http://localhost:7990/projects/PRO3"
}
]
}
},
"public": false,
"archived": false,
"links": {
"clone": [
{
"href": "ssh://git@localhost:7999/pro3/repostiroy-3.git",
"name": "ssh"
},
{
"href": "http://localhost:7990/scm/pro3/repostiroy-3.git",
"name": "http"
}
],
"self": [
{
"href": "http://localhost:7990/projects/PRO3/repos/repostiroy-3/browse"
}
]
},
"__readme": "",
"__latestCommit": {
"id": "965068d1461f119139bb6be582bb22a555a195ba",
"displayId": "965068d1461",
"author": {
"name": "[REDACTED]",
"emailAddress": "admin@gmail.com",
"active": true,
"displayName": "Admin",
"id": 3,
"slug": "[REDACTED]",
"type": "NORMAL",
"links": {
"self": [
{
"href": "http://localhost:7990/users/[REDACTED]"
}
]
}
},
"authorTimestamp": 1747744649000,
"committer": {
"name": "[REDACTED]",
"emailAddress": "admin@gmail.com",
"active": true,
"displayName": "Admin",
"id": 3,
"slug": "[REDACTED]",
"type": "NORMAL",
"links": {
"self": [
{
"href": "http://localhost:7990/users/[REDACTED]"
}
]
}
},
"committerTimestamp": 1747744649000,
"message": "Pull request #1: readme.md edited online with Bitbucket\n\nMerge in PRO3/repostiroy-3 from main to master\n\n* commit '3e4df0573a0ba1845ebdfa919c907745497313aa':\n readme.md edited online with Bitbucket",
"parents": [
{
"id": "9534663d88977c0aa5c25249986eae851fd83a8d",
"displayId": "9534663d889"
},
{
"id": "3e4df0573a0ba1845ebdfa919c907745497313aa",
"displayId": "3e4df0573a0"
}
]
}
}
Pull Request response data
{
"id": 1,
"version": 1,
"title": "readme.md edited online with Bitbucket",
"state": "OPEN",
"open": true,
"closed": false,
"draft": false,
"createdDate": 1747730324792,
"updatedDate": 1747730324792,
"fromRef": {
"id": "refs/heads/main",
"displayId": "main",
"latestCommit": "3e4df0573a0ba1845ebdfa919c907745497313aa",
"type": "BRANCH",
"repository": {
"slug": "repostiroy-3",
"id": 3,
"name": "Repostiroy 3",
"hierarchyId": "0a8dadb07bb606236d8c",
"scmId": "git",
"state": "AVAILABLE",
"statusMessage": "Available",
"forkable": true,
"project": {
"key": "PRO3",
"id": 3,
"name": "Project Three",
"public": false,
"type": "NORMAL",
"links": {
"self": [
{
"href": "http://localhost:7990/projects/PRO3"
}
]
}
},
"public": false,
"archived": false,
"links": {
"clone": [
{
"href": "ssh://git@localhost:7999/pro3/repostiroy-3.git",
"name": "ssh"
},
{
"href": "http://localhost:7990/scm/pro3/repostiroy-3.git",
"name": "http"
}
],
"self": [
{
"href": "http://localhost:7990/projects/PRO3/repos/repostiroy-3/browse"
}
]
}
}
},
"toRef": {
"id": "refs/heads/master",
"displayId": "master",
"latestCommit": "9534663d88977c0aa5c25249986eae851fd83a8d",
"type": "BRANCH",
"repository": {
"slug": "repostiroy-3",
"id": 3,
"name": "Repostiroy 3",
"hierarchyId": "0a8dadb07bb606236d8c",
"scmId": "git",
"state": "AVAILABLE",
"statusMessage": "Available",
"forkable": true,
"project": {
"key": "PRO3",
"id": 3,
"name": "Project Three",
"public": false,
"type": "NORMAL",
"links": {
"self": [
{
"href": "http://localhost:7990/projects/PRO3"
}
]
}
},
"public": false,
"archived": false,
"links": {
"clone": [
{
"href": "ssh://git@localhost:7999/pro3/repostiroy-3.git",
"name": "ssh"
},
{
"href": "http://localhost:7990/scm/pro3/repostiroy-3.git",
"name": "http"
}
],
"self": [
{
"href": "http://localhost:7990/projects/PRO3/repos/repostiroy-3/browse"
}
]
}
}
},
"locked": false,
"author": {
"user": {
"name": "[REDACTED]",
"emailAddress": "admin@gmail.com",
"active": true,
"displayName": "Admin",
"id": 3,
"slug": "[REDACTED]",
"type": "NORMAL",
"links": {
"self": [
{
"href": "http://localhost:7990/users/[REDACTED]"
}
]
}
},
"role": "AUTHOR",
"approved": false,
"status": "UNAPPROVED"
},
"reviewers": [],
"participants": [],
"properties": {
"mergeResult": {
"outcome": "CLEAN",
"current": false
},
"resolvedTaskCount": 0,
"commentCount": 0,
"openTaskCount": 0
},
"links": {
"self": [
{
"href": "http://localhost:7990/projects/PRO3/repos/repostiroy-3/pull-requests/1"
}
]
}
}
User response data
{
"name": "[REDACTED]",
"emailAddress": "admin@gmail.com",
"active": true,
"displayName": "Admin",
"id": 3,
"slug": "[REDACTED]",
"type": "NORMAL",
"links": {
"self": [
{
"href": "http://localhost:7990/users/[REDACTED]"
}
]
}
}
Mapping Result
The combination of the sample payload and the Ocean configuration generates the following Port entity:
Project entity in Port
{
"blueprint": "bitbucketProject",
"identifier": "PROJ",
"createdAt": "2025-05-20T09:14:22.361Z",
"updatedBy": "jqoQ34Azuy08BJFFUZAKyP3sXranvmgc",
"createdBy": "jqoQ34Azuy08BJFFUZAKyP3sXranvmgc",
"team": [],
"title": "Project",
"relations": {},
"properties": {
"public": false,
"link": "http://localhost:7990/projects/PROJ",
"description": null,
"type": "NORMAL"
},
"updatedAt": "2025-05-22T20:46:27.616Z"
}
Repository entity in Port
{
"blueprint": "bitbucketRepository",
"identifier": "repostiroy-3",
"createdAt": "2025-05-20T13:14:09.505Z",
"updatedBy": "jqoQ34Azuy08BJFFUZAKyP3sXranvmgc",
"createdBy": "jqoQ34Azuy08BJFFUZAKyP3sXranvmgc",
"team": [],
"title": "Repostiroy-3",
"relations": {
"project": "PRO3",
"latestCommitAuthor": "admin@gmail.com"
},
"properties": {
"public": false,
"documentation": "",
"link": "http://localhost:7990/projects/PRO3/repos/repostiroy-3/browse",
"forkable": true,
"description": null,
"state": "AVAILABLE",
"readme": null,
"swagger_url": null
},
"updatedAt": "2025-05-20T13:14:09.505Z"
}
Pull Request entity in Port
{
"blueprint": "bitbucketPullRequest",
"identifier": "1",
"createdAt": "2025-05-20T09:22:29.565Z",
"updatedBy": "jqoQ34Azuy08BJFFUZAKyP3sXranvmgc",
"createdBy": "jqoQ34Azuy08BJFFUZAKyP3sXranvmgc",
"team": [],
"title": "readme.md edited online with Bitbucket",
"relations": {
"repository": "repostiroy-3",
"participants": []
},
"properties": {
"updated_on": "2025-05-20T12:37:29Z",
"owner": "admin@gmail.com",
"created_on": "2025-05-20T08:38:44Z",
"mergedAt": "2025-05-20T12:37:29Z",
"link": "http://localhost:7990/projects/PRO3/repos/repostiroy-3/pull-requests/1",
"destination": "master",
"description": null,
"state": "MERGED",
"source": "main",
"reviewers": [],
"merge_commit": "3e4df0573a0ba1845ebdfa919c907745497313aa"
},
"updatedAt": "2025-05-20T12:37:34.111Z"
}
User entity in Port
{
"blueprint": "bitbucketUser",
"identifier": "admin@gmail.com",
"createdAt": "2025-05-20T09:10:04.195Z",
"updatedBy": "jqoQ34Azuy08BJFFUZAKyP3sXranvmgc",
"createdBy": "jqoQ34Azuy08BJFFUZAKyP3sXranvmgc",
"team": [],
"title": "Admin",
"relations": {},
"properties": {
"portUser": "admin@gmail.com",
"url": "http://localhost:7990/users/admin",
"username": "admin"
},
"updatedAt": "2025-05-20T09:10:04.195Z"
}
Alternative Installation Via Webhooks
While the Ocean integration described above is the recommended installation method, you may prefer to use a webhook to ingest data from Jira. If so, you can follow the instructions in the webhook section.