diff --git a/docs/build-your-software-catalog/custom-integration/gitops.md b/docs/build-your-software-catalog/custom-integration/gitops.md index 39c28211f1..264226ad25 100644 --- a/docs/build-your-software-catalog/custom-integration/gitops.md +++ b/docs/build-your-software-catalog/custom-integration/gitops.md @@ -13,5 +13,5 @@ To use Gitops with Port, head over to your desired Git provider: - [GitHub](/build-your-software-catalog/sync-data-to-catalog/git/github/gitops) - [GitLab](/build-your-software-catalog/sync-data-to-catalog/git/gitlab/gitops) -- [Bitbucket](/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/gitops) +- [Bitbucket](/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/gitops) - [Azure DevOps](/build-your-software-catalog/sync-data-to-catalog/git/azure-devops/gitops) \ No newline at end of file diff --git a/docs/build-your-software-catalog/custom-integration/webhook/examples/bitbucket-server/_category_.json b/docs/build-your-software-catalog/custom-integration/webhook/examples/bitbucket-server/_category_.json deleted file mode 100644 index d8901f87a2..0000000000 --- a/docs/build-your-software-catalog/custom-integration/webhook/examples/bitbucket-server/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "Bitbucket (Self-Hosted)", - "position": 19 -} \ No newline at end of file diff --git a/docs/build-your-software-catalog/custom-integration/webhook/examples/bitbucket-server/bitbucket-server.md b/docs/build-your-software-catalog/custom-integration/webhook/examples/bitbucket-server/bitbucket-server.md deleted file mode 100644 index 94913b2a08..0000000000 --- a/docs/build-your-software-catalog/custom-integration/webhook/examples/bitbucket-server/bitbucket-server.md +++ /dev/null @@ -1,344 +0,0 @@ ---- -sidebar_position: 19 -description: Ingest Bitbucket Server projects, repositories and pull requests into your catalog ---- - -import BitbucketProjectBlueprint from "../resources/bitbucket-server/\_example_bitbucket_project_blueprint.mdx"; -import BitbucketUserBlueprint from "../resources/bitbucket-server/\_example_bitbucket_user_blueprint.mdx"; -import BitbucketPullrequestBlueprint from "../resources/bitbucket-server/\_example_bitbucket_pull_request_blueprint.mdx"; -import BitbucketRepositoryBlueprint from "../resources/bitbucket-server/\_example_bitbucket_repository_blueprint.mdx"; -import BitbucketWebhookConfiguration from "../resources/bitbucket-server/\_example_bitbucket_webhook_config.mdx"; -import BitbucketServerPythonScript from "../resources/bitbucket-server/\_example_bitbucket_python_script.mdx"; - -# Bitbucket (Self-Hosted) - -In this example you are going to create a webhook integration between your Bitbucket Server and Port. The integration will facilitate the ingestion of Bitbucket user, project, repository and pull request entities into Port. - -## Port configuration - -Create the following blueprint definitions: - -
-Bitbucket project blueprint - - - -
- -
-Bitbucket user blueprint - - - -
- -
-Bitbucket repository blueprint - - - -
- -
-Bitbucket pull request blueprint - - - -
- -:::tip Blueprint Properties -You may modify the properties in your blueprints depending on what you want to track in your Bitbucket account. -::: - -## Let's Test It - -This section includes a sample webhook event sent from Bitbucket when a pull request is merged. In addition, it includes the entity created from the event based on the webhook configuration provided in the previous section. - -### Payload - -Here is an example of the payload structure sent to the webhook URL when a Bitbucket pull request is merged: - -
- Webhook event payload - -```json showLineNumbers -{ - "body": { - "eventKey": "pr:merged", - "date": "2023-11-16T11:03:42+0000", - "actor": { - "name": "admin", - "emailAddress": "username@gmail.com", - "active": true, - "displayName": "Test User", - "id": 2, - "slug": "admin", - "type": "NORMAL", - "links": { - "self": [ - { - "href": "http://myhost:7990/users/admin" - } - ] - } - }, - "pullRequest": { - "id": 2, - "version": 2, - "title": "lint code", - "description": "here is the description", - "state": "MERGED", - "open": false, - "closed": true, - "createdDate": 1700132280533, - "updatedDate": 1700132622026, - "closedDate": 1700132622026, - "fromRef": { - "id": "refs/heads/dev", - "displayId": "dev", - "latestCommit": "9e08604e14fa72265d65696608725c2b8f7850f2", - "type": "BRANCH", - "repository": { - "slug": "data-analyses", - "id": 1, - "name": "data analyses", - "description": "This is for my repository and all the blah blah blah", - "hierarchyId": "24cfae4b0dd7bade7edc", - "scmId": "git", - "state": "AVAILABLE", - "statusMessage": "Available", - "forkable": true, - "project": { - "key": "MOPP", - "id": 1, - "name": "My On Prem Project", - "description": "On premise test project is sent to us for us", - "public": false, - "type": "NORMAL", - "links": { - "self": [ - { - "href": "http://myhost:7990/projects/MOPP" - } - ] - } - }, - "public": false, - "archived": false, - "links": { - "clone": [ - { - "href": "ssh://git@myhost:7999/mopp/data-analyses.git", - "name": "ssh" - }, - { - "href": "http://myhost:7990/scm/mopp/data-analyses.git", - "name": "http" - } - ], - "self": [ - { - "href": "http://myhost:7990/projects/MOPP/repos/data-analyses/browse" - } - ] - } - } - }, - "toRef": { - "id": "refs/heads/main", - "displayId": "main", - "latestCommit": "e461aae894b6dc951f405dca027a3f5567ea6bee", - "type": "BRANCH", - "repository": { - "slug": "data-analyses", - "id": 1, - "name": "data analyses", - "description": "This is for my repository and all the blah blah blah", - "hierarchyId": "24cfae4b0dd7bade7edc", - "scmId": "git", - "state": "AVAILABLE", - "statusMessage": "Available", - "forkable": true, - "project": { - "key": "MOPP", - "id": 1, - "name": "My On Prem Project", - "description": "On premise test project is sent to us for us", - "public": false, - "type": "NORMAL", - "links": { - "self": [ - { - "href": "http://myhost:7990/projects/MOPP" - } - ] - } - }, - "public": false, - "archived": false, - "links": { - "clone": [ - { - "href": "ssh://git@myhost:7999/mopp/data-analyses.git", - "name": "ssh" - }, - { - "href": "http://myhost:7990/scm/mopp/data-analyses.git", - "name": "http" - } - ], - "self": [ - { - "href": "http://myhost:7990/projects/MOPP/repos/data-analyses/browse" - } - ] - } - } - }, - "locked": false, - "author": { - "user": { - "name": "admin", - "emailAddress": "username@gmail.com", - "active": true, - "displayName": "Test User", - "id": 2, - "slug": "admin", - "type": "NORMAL", - "links": { - "self": [ - { - "href": "http://myhost:7990/users/admin" - } - ] - } - }, - "role": "AUTHOR", - "approved": false, - "status": "UNAPPROVED" - }, - "reviewers": [], - "participants": [], - "properties": { - "mergeCommit": { - "displayId": "1cbccf99220", - "id": "1cbccf99220b23f89624c7c604f630663a1aaf8e" - } - }, - "links": { - "self": [ - { - "href": "http://myhost:7990/projects/MOPP/repos/data-analyses/pull-requests/2" - } - ] - } - } - }, - "headers": { - "X-Forwarded-For": "10.0.148.57", - "X-Forwarded-Proto": "https", - "X-Forwarded-Port": "443", - "Host": "ingest.getport.io", - "X-Amzn-Trace-Id": "Self=1-6555f719-267a0fce1e7a4d8815de94f7;Root=1-6555f719-1906872f41621b17250bb83a", - "Content-Length": "2784", - "User-Agent": "Atlassian HttpClient 3.0.4 / Bitbucket-8.15.1 (8015001) / Default", - "Content-Type": "application/json; charset=UTF-8", - "accept": "*/*", - "X-Event-Key": "pr:merged", - "X-Hub-Signature": "sha256=bf366faf8d8c41a4af21d25d922b87c3d1d127b5685238b099d2f311ad46e978", - "X-Request-Id": "d5fa6a16-bb6c-40d6-9c50-bc4363e79632", - "via": "HTTP/1.1 AmazonAPIGateway", - "forwarded": "for=154.160.30.235;host=ingest.getport.io;proto=https" - }, - "queryParams": {} -} -``` - -
- - -
- Mapping Result - -```json showLineNumbers -{ - "identifier":"2", - "title":"lint code", - "blueprint":"bitbucketPullrequest", - "properties":{ - "created_on":"2023-11-16T10:58:00Z", - "updated_on":"2023-11-16T11:03:42Z", - "merge_commit":"9e08604e14fa72265d65696608725c2b8f7850f2", - "state":"MERGED", - "owner":"Test User", - "link":"http://myhost:7990/projects/MOPP/repos/data-analyses/pull-requests/2", - "destination":"main", - "source":"dev", - "participants":[], - "reviewers":[] - }, - "relations":{ - "repository":"data-analyses" - }, - "filter":true -} -``` -
- -## Import Bitbucket Historical Issues - -In this example you are going to use the provided Python script to set up webhooks and fetch data from the Bitbucket Server API and ingest it to Port. - -### Prerequisites - -This example utilizes the [blueprint](#port-configuration) definition from the previous section. - -In addition, provide the following environment variables: - -- `PORT_CLIENT_ID` - Your Port client id -- `PORT_CLIENT_SECRET` - Your Port client secret -- `BITBUCKET_HOST` - Bitbucket server host such as `http://localhost:7990` -- `BITBUCKET_USERNAME` - Bitbucket username to use when accessing the Bitbucket resources -- `BITBUCKET_PASSWORD` - Bitbucket account password -- `BITBUCKET_PROJECTS_FILTER` - An optional comma separated list of Bitbucket projects to filter. If not provided, all projects will be fetched. -- `WEBHOOK_SECRET` - An optional secret to use when creating a webhook in Port. If not provided, `bitbucket_webhook_secret` will be used. -- `PORT_API_URL` - An optional variable that defaults to the EU Port API `https://api.getport.io/v1`. For US organizations use `https://api.us.getport.io/v1` instead. -- `IS_VERSION_8_7_OR_OLDER` - An optional variable that specifies whether the Bitbucket version is older than 8.7. This setting determines if webhooks should be created at the repository level (for older versions `<=8.7`) or at the project level (for newer versions `>=8.8`). -- `PULL_REQUEST_STATE` - An optional variable to specify the state of Bitbucket pull requests to be ingested. Accepted values are `"ALL"`, `"OPEN"`, `"MERGED"`, or `"DECLINED"`. If not specified, the default value is `OPEN`. - -:::tip Webhook Configuration -This app will automatically set up a webhook that allows Bitbucket to send events to Port. To understand more about how Bitbucket sends event payloads via webhooks, you can refer to [this documentation](https://confluence.atlassian.com/bitbucketserver/event-payload-938025882.html). - -Ensure that the Bitbucket credentials you use have `PROJECT_ADMIN` permissions to successfully configure the webhook. For more details on the necessary permissions and setup, see the [official Bitbucket documentation](https://developer.atlassian.com/server/bitbucket/rest/v910/api-group-project/#api-api-latest-projects-projectkey-webhooks-post). -::: - - -:::info -Find your Port credentials using this [guide](https://docs.port.io/build-your-software-catalog/custom-integration/api/#find-your-port-credentials) -::: - -Use the following Python script to set up webhook and ingest historical Bitbucket users, projects, repositories and pull requests into port: - -
-Bitbucket Python script - -:::tip Latest Version -You can pull the latest version of this code by cloning this [repository](https://github.com/port-labs/bitbucket-workspace-data/) -::: - - - -
- -
-Bitbucket webhook configuration - - - -
- -Done! you are now able to import historical users, projects, repositories and pull requests from Bitbucket into Port and any change that happens to your project, repository or pull requests in Bitbucket will trigger a webhook event to the webhook URL provided by Port. Port will parse the events and objects according to the mapping and update the catalog entities accordingly. - -## GitOps - -Port's Bitbucket (Self-Hosted) integration also provides GitOps capabilities, refer to the [GitOps](./gitops.md) page to learn more. diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/_category_.json b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/_category_.json index 2f99113aff..67ba0fed0a 100644 --- a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/_category_.json +++ b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/_category_.json @@ -1,4 +1,4 @@ { - "label": "Bitbucket (deprecated)", - "position": 2 -} + "label": "Bitbucket", + "position": 3 +} \ No newline at end of file diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/_bitbucket_exporter_example_monorepo_port_app_config.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/_bitbucket_exporter_example_monorepo_port_app_config.mdx similarity index 100% rename from docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/_bitbucket_exporter_example_monorepo_port_app_config.mdx rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/_bitbucket_exporter_example_monorepo_port_app_config.mdx diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/_bitbucket_exporter_example_port_app_config.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/_bitbucket_exporter_example_port_app_config.mdx similarity index 100% rename from docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/_bitbucket_exporter_example_port_app_config.mdx rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/_bitbucket_exporter_example_port_app_config.mdx diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/_bitbucket_exporter_example_pull_request_blueprint.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/_bitbucket_exporter_example_pull_request_blueprint.mdx similarity index 100% rename from docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/_bitbucket_exporter_example_pull_request_blueprint.mdx rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/_bitbucket_exporter_example_pull_request_blueprint.mdx diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/_bitbucket_exporter_example_repository_blueprint.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/_bitbucket_exporter_example_repository_blueprint.mdx similarity index 100% rename from docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/_bitbucket_exporter_example_repository_blueprint.mdx rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/_bitbucket_exporter_example_repository_blueprint.mdx diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/_bitbucket_exporter_supported_resources.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/_bitbucket_exporter_supported_resources.mdx similarity index 100% rename from docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/_bitbucket_exporter_supported_resources.mdx rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/_bitbucket_exporter_supported_resources.mdx diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/_category_.json b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/_category_.json new file mode 100644 index 0000000000..bd30a69c81 --- /dev/null +++ b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Bitbucket app (deprecated)", + "position": 3 +} diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/advanced.md b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/advanced.md similarity index 91% rename from docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/advanced.md rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/advanced.md index e8d73fd54e..3dd33622a5 100644 --- a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/advanced.md +++ b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/advanced.md @@ -4,7 +4,7 @@ sidebar_position: 4 import Tabs from "@theme/Tabs" import TabItem from "@theme/TabItem" -import DeleteDependents from '../../../../generalTemplates/\_delete_dependents_git_explanation_template.md' +import DeleteDependents from '../../../../../generalTemplates/\_delete_dependents_git_explanation_template.md' # Advanced @@ -57,4 +57,4 @@ The `createMissingRelatedEntities` parameter is used to enable the creation of m -All of the advanced configurations listed below can be added to the [`port-app-config.yml`](./bitbucket.md#port-app-configyml-file) file. +All of the advanced configurations listed above can be added to the [`port-app-config.yml`](./bitbucket-app.md#port-app-configyml-file) file. diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket.md b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/bitbucket-app.md similarity index 96% rename from docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket.md rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/bitbucket-app.md index a44cdb2148..b35e82215c 100644 --- a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket.md +++ b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/bitbucket-app.md @@ -3,20 +3,18 @@ import TabItem from "@theme/TabItem" import BitbucketResources from './\_bitbucket_exporter_supported_resources.mdx' -# Bitbucket +# Bitbucket app (deprecated) -Port's Bitbucket integration allows you to model Bitbucket resources in your software catalog and ingest data into them. +Port's Bitbucket App integration allows you to model Bitbucket resources in your software catalog and ingest data into them. :::warning Deprecation Notice This app will be deprecated in the future and support for the app will be discontinued soon. -To integrate Port with Bitbucket Cloud, we recommend using the [Bitbucket Cloud integration](/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/). +To integrate Port with Bitbucket Cloud, we recommend using the [Bitbucket Cloud integration](/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/). ::: -:::info Bitbucket Server (Self-Hosted) This documentation covers Port's integration with **Bitbucket Cloud**. -For information about integrating with Bitbucket Server (Self-Hosted), please refer to the [Bitbucket Server integration documentation](/build-your-software-catalog/custom-integration/webhook/examples/bitbucket-server/bitbucket-server.md). -::: +For information about integrating with Bitbucket Server (Self-Hosted), please refer to the [Bitbucket Server integration documentation](/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/bitbucket-server.md). ## Overview diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/examples.md b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/examples.md similarity index 93% rename from docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/examples.md rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/examples.md index cb8b025add..8d91ecde16 100644 --- a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/examples.md +++ b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/examples.md @@ -22,7 +22,7 @@ In the following example you will ingest your Bitbucket repositories, their READ :::tip -- Refer to the [setup](bitbucket.md#setup) section to learn more about the `port-app-config.yml` setup process; +- Refer to the [setup](bitbucket-app.md#setup) section to learn more about the `port-app-config.yml` setup process; - We leverage [JQ JSON processor](https://stedolan.github.io/jq/manual/) to map and transform Bitbucket objects to Port Entities; - Click [Here](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-get) for the Bitbucket repository object structure. - Click [Here](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-get) for the Bitbucket pull request object structure. @@ -41,7 +41,7 @@ In the following example you will ingest your Bitbucket repositories and their f :::tip -- Refer to the [setup](bitbucket.md#setup) section to learn more about the `port-app-config.yml` setup process; +- Refer to the [setup](bitbucket-app.md#setup) section to learn more about the `port-app-config.yml` setup process; - We leverage [JQ JSON processor](https://stedolan.github.io/jq/manual/) to map and transform GitHub objects to Port Entities; - Click [Here](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-get) for the Bitbucket repository object structure. - Click [Here](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-source/#api-repositories-workspace-repo-slug-src-commit-path-get) for the Bitbucket folder object structure. diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/gitops/_category_.json b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/gitops/_category_.json similarity index 100% rename from docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/gitops/_category_.json rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/gitops/_category_.json diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/gitops/gitops.md b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/gitops/gitops.md similarity index 82% rename from docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/gitops/gitops.md rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/gitops/gitops.md index d4060bf122..f0feab36d5 100644 --- a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/gitops/gitops.md +++ b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/gitops/gitops.md @@ -4,19 +4,19 @@ sidebar_position: 3 import Tabs from "@theme/Tabs" import TabItem from "@theme/TabItem" -import PortYmlStructure from '../../\_port_yml_gitops_structure_template.md' -import BasicFileProperties from '../../\_basic_file_properties_template.md' -import RelativeFileProperties from '../../\_relative_file_properties_template.md' -import GitOpsPushEvent from '../../\_git_gitops_push_events_explanation.mdx' -import PortYmlIngestionPattern from '../../\_port_yml_ingestion_pattern_template.md' +import PortYmlStructure from '../../../\_port_yml_gitops_structure_template.md' +import BasicFileProperties from '../../../\_basic_file_properties_template.md' +import RelativeFileProperties from '../../../\_relative_file_properties_template.md' +import GitOpsPushEvent from '../../../\_git_gitops_push_events_explanation.mdx' +import PortYmlIngestionPattern from '../../../\_port_yml_ingestion_pattern_template.md' # GitOps Port's Bitbucket integration makes it possible to manage Port entities with a GitOps approach, making your code repositories into the source of truth for the various infrastructure assets you want to manage. :::info Bitbucket Server (Self-Hosted) -This documentation covers GitOps for **Bitbucket Cloud**. -For information about GitOps with Bitbucket Server (Self-Hosted), please refer to the [Bitbucket Server GitOps documentation](/build-your-software-catalog/custom-integration/webhook/examples/bitbucket-server/gitops.md). +This documentation covers GitOps for **Bitbucket App**. +For information about GitOps with Bitbucket Server (Self-Hosted), please refer to the [Bitbucket Server GitOps documentation](/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/gitops.md). ::: @@ -30,7 +30,7 @@ For information about GitOps with Bitbucket Server (Self-Hosted), please refer t To manage entities using GitOps, you will need to add a `port.yml` file to the **default branch** (usually `main`) of your repository. -Note that the `port.yml` file is not the same as the [`port-app-config.yml` file](/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/#port-app-configyml-file) used to configure the BitBucket integration, and does not replace it. +Note that the `port.yml` file is not the same as the [`port-app-config.yml` file](/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/#port-app-configyml-file) used to configure the BitBucket integration, and does not replace it. The `port.yml` file can specify one or more Port entities that will be ingested to Port, and any change made to the `port.yml` file will also be reflected inside Port. diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/_bitbucket_cloud_one_time_docker_parameters.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/_bitbucket_cloud_one_time_docker_parameters.mdx similarity index 100% rename from docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/_bitbucket_cloud_one_time_docker_parameters.mdx rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/_bitbucket_cloud_one_time_docker_parameters.mdx diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/_bitbucket_integration_example_file_blueprint.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/_bitbucket_integration_example_file_blueprint.mdx similarity index 100% rename from docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/_bitbucket_integration_example_file_blueprint.mdx rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/_bitbucket_integration_example_file_blueprint.mdx diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/_bitbucket_integration_example_file_port_app_config.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/_bitbucket_integration_example_file_port_app_config.mdx similarity index 100% rename from docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/_bitbucket_integration_example_file_port_app_config.mdx rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/_bitbucket_integration_example_file_port_app_config.mdx diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/_bitbucket_integration_example_monorepo_port_app_config.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/_bitbucket_integration_example_monorepo_port_app_config.mdx similarity index 100% rename from docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/_bitbucket_integration_example_monorepo_port_app_config.mdx rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/_bitbucket_integration_example_monorepo_port_app_config.mdx diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/_bitbucket_integration_example_port_app_config.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/_bitbucket_integration_example_port_app_config.mdx similarity index 100% rename from docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/_bitbucket_integration_example_port_app_config.mdx rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/_bitbucket_integration_example_port_app_config.mdx diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/_bitbucket_integration_example_project_blueprint.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/_bitbucket_integration_example_project_blueprint.mdx similarity index 100% rename from docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/_bitbucket_integration_example_project_blueprint.mdx rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/_bitbucket_integration_example_project_blueprint.mdx diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/_bitbucket_integration_example_pull_request_blueprint.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/_bitbucket_integration_example_pull_request_blueprint.mdx similarity index 100% rename from docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/_bitbucket_integration_example_pull_request_blueprint.mdx rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/_bitbucket_integration_example_pull_request_blueprint.mdx diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/_bitbucket_integration_example_repository_blueprint.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/_bitbucket_integration_example_repository_blueprint.mdx similarity index 100% rename from docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/_bitbucket_integration_example_repository_blueprint.mdx rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/_bitbucket_integration_example_repository_blueprint.mdx diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/_bitbucket_integration_supported_resources.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/_bitbucket_integration_supported_resources.mdx similarity index 100% rename from docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/_bitbucket_integration_supported_resources.mdx rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/_bitbucket_integration_supported_resources.mdx diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/_category_.json b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/_category_.json similarity index 100% rename from docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/_category_.json rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/_category_.json diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/advanced.md b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/advanced.md similarity index 92% rename from docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/advanced.md rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/advanced.md index 797e9b3813..aaf1dc7a76 100644 --- a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/advanced.md +++ b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/advanced.md @@ -4,7 +4,7 @@ sidebar_position: 4 import Tabs from "@theme/Tabs" import TabItem from "@theme/TabItem" -import DeleteDependents from '../../../../generalTemplates/\_delete_dependents_git_explanation_template.md' +import DeleteDependents from '../../../../../generalTemplates/\_delete_dependents_git_explanation_template.md' # Advanced diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/bitbucket-cloud.md b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/bitbucket-cloud.md similarity index 98% rename from docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/bitbucket-cloud.md rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/bitbucket-cloud.md index c233ea6836..52d79db3a0 100644 --- a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/bitbucket-cloud.md +++ b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/bitbucket-cloud.md @@ -1,3 +1,7 @@ +--- +sidebar_position: 2 +--- + import Tabs from "@theme/Tabs" import TabItem from "@theme/TabItem" import BitbucketResources from './\_bitbucket_integration_supported_resources.mdx' @@ -9,7 +13,7 @@ Port's Bitbucket integration allows you to model Bitbucket cloud resources in yo :::info Bitbucket Server (Self-Hosted) This documentation covers Port's integration with **Bitbucket Cloud**. -For information about integrating with Bitbucket Server (Self-Hosted), please refer to the [Bitbucket Server integration documentation](/build-your-software-catalog/custom-integration/webhook/examples/bitbucket-server/bitbucket-server.md). +For information about integrating with Bitbucket Server (Self-Hosted), please refer to the [Bitbucket Server integration documentation](/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/bitbucket-server.md). ::: @@ -20,7 +24,7 @@ This integration allows you to: - Map and organize your desired Bitbucket cloud 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. - Map and ingest monorepo repositories. -- Manage port entities using GitOps. +- Manage Port entities using GitOps. ### Supported resources diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/examples.md b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/examples.md similarity index 100% rename from docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/examples.md rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/examples.md diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/gitops/_category_.json b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/gitops/_category_.json similarity index 100% rename from docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/gitops/_category_.json rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/gitops/_category_.json diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/gitops/gitops.md b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/gitops/gitops.md similarity index 85% rename from docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/gitops/gitops.md rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/gitops/gitops.md index bfce0c5117..f56dca7af4 100644 --- a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/gitops/gitops.md +++ b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/gitops/gitops.md @@ -4,10 +4,10 @@ sidebar_position: 3 import Tabs from "@theme/Tabs" import TabItem from "@theme/TabItem" -import PortYmlStructure from '../../\_port_yml_gitops_structure_template.md' -import BasicFileProperties from '../../\_basic_file_properties_template.md' -import RelativeFileProperties from '../../\_relative_file_properties_template.md' -import PortYmlIngestionPattern from '../../\_port_yml_ingestion_pattern_template.md' +import PortYmlStructure from '../../../\_port_yml_gitops_structure_template.md' +import BasicFileProperties from '../../../\_basic_file_properties_template.md' +import RelativeFileProperties from '../../../\_relative_file_properties_template.md' +import PortYmlIngestionPattern from '../../../\_port_yml_ingestion_pattern_template.md' # GitOps @@ -15,7 +15,7 @@ Port's Bitbucket integration makes it possible to manage Port entities with a Gi :::info Bitbucket Server (Self-Hosted) This documentation covers GitOps for **Bitbucket Cloud**. -For information about GitOps with Bitbucket Server (Self-Hosted), please refer to the [Bitbucket Server GitOps documentation](/build-your-software-catalog/custom-integration/webhook/examples/bitbucket-server/gitops.md). +For information about GitOps with Bitbucket Server (Self-Hosted), please refer to the [Bitbucket Server GitOps documentation](/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/gitops.md). ::: @@ -29,7 +29,7 @@ For information about GitOps with Bitbucket Server (Self-Hosted), please refer t To manage entities using GitOps, you will need to add a `port.yml` file to the **default branch** (usually `main`) of your repository. -Note that the `port.yml` file is not the same as the [`port-app-config.yml` file](/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/#port-app-configyml-file) used to configure the BitBucket integration, and does not replace it. +Note that the `port.yml` file is not the same as the [`port-app-config.yml` file](/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/#port-app-configyml-file) used to configure the BitBucket integration, and does not replace it. The `port.yml` file can specify one or more Port entities that will be ingested to Port, and any change made to the `port.yml` file will also be reflected inside Port. diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/installation.md b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/installation.md similarity index 98% rename from docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/installation.md rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/installation.md index 0589d224dc..ea649050ec 100644 --- a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket-cloud/installation.md +++ b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/installation.md @@ -4,11 +4,11 @@ sidebar_position: 1 import Tabs from "@theme/Tabs" import TabItem from "@theme/TabItem" -import AzurePremise from "../../templates/\_ocean_azure_premise.mdx" -import Prerequisites from "../../templates/\_ocean_helm_prerequisites_block.mdx" -import HelmParameters from "../../templates/\_ocean-advanced-parameters-helm.mdx" +import AzurePremise from "../../../templates/\_ocean_azure_premise.mdx" +import Prerequisites from "../../../templates/\_ocean_helm_prerequisites_block.mdx" +import HelmParameters from "../../../templates/\_ocean-advanced-parameters-helm.mdx" import DockerParameters from "./\_bitbucket_cloud_one_time_docker_parameters.mdx" -import AdvancedConfig from '../../../../generalTemplates/_ocean_advanced_configuration_note.md' +import AdvancedConfig from '../../../../../generalTemplates/_ocean_advanced_configuration_note.md' import PortApiRegionTip from "/docs/generalTemplates/_port_region_parameter_explanation_template.md" import OceanSaasInstallation from "/docs/build-your-software-catalog/sync-data-to-catalog/templates/_ocean_saas_installation.mdx" import OceanRealtimeInstallation from "/docs/build-your-software-catalog/sync-data-to-catalog/templates/_ocean_realtime_installation.mdx" diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/_resources/_bitbucket_cloud_one_time_docker_parameters.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/_resources/_bitbucket_cloud_one_time_docker_parameters.mdx new file mode 100644 index 0000000000..df9628e2b1 --- /dev/null +++ b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/_resources/_bitbucket_cloud_one_time_docker_parameters.mdx @@ -0,0 +1,14 @@ +| 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](https://docs.port.io/build-your-software-catalog/custom-integration/api/#find-your-port-credentials)) id | | ✅ | +| `OCEAN__PORT__CLIENT_SECRET` | Your Port client ([How to get the credentials](https://docs.port.io/build-your-software-catalog/custom-integration/api/#find-your-port-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](https://ocean.getport.io/develop-an-integration/integration-configuration/#initializeportresources---initialize-port-resources) | | ❌ | +| `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 | | ❌ | \ No newline at end of file diff --git a/docs/build-your-software-catalog/custom-integration/webhook/examples/resources/bitbucket-server/_example_bitbucket_project_blueprint.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/_resources/_example_bitbucket_project_blueprint.mdx similarity index 100% rename from docs/build-your-software-catalog/custom-integration/webhook/examples/resources/bitbucket-server/_example_bitbucket_project_blueprint.mdx rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/_resources/_example_bitbucket_project_blueprint.mdx diff --git a/docs/build-your-software-catalog/custom-integration/webhook/examples/resources/bitbucket-server/_example_bitbucket_pull_request_blueprint.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/_resources/_example_bitbucket_pull_request_blueprint.mdx similarity index 100% rename from docs/build-your-software-catalog/custom-integration/webhook/examples/resources/bitbucket-server/_example_bitbucket_pull_request_blueprint.mdx rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/_resources/_example_bitbucket_pull_request_blueprint.mdx diff --git a/docs/build-your-software-catalog/custom-integration/webhook/examples/resources/bitbucket-server/_example_bitbucket_python_script.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/_resources/_example_bitbucket_python_script.mdx similarity index 100% rename from docs/build-your-software-catalog/custom-integration/webhook/examples/resources/bitbucket-server/_example_bitbucket_python_script.mdx rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/_resources/_example_bitbucket_python_script.mdx diff --git a/docs/build-your-software-catalog/custom-integration/webhook/examples/resources/bitbucket-server/_example_bitbucket_repository_blueprint.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/_resources/_example_bitbucket_repository_blueprint.mdx similarity index 100% rename from docs/build-your-software-catalog/custom-integration/webhook/examples/resources/bitbucket-server/_example_bitbucket_repository_blueprint.mdx rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/_resources/_example_bitbucket_repository_blueprint.mdx diff --git a/docs/build-your-software-catalog/custom-integration/webhook/examples/resources/bitbucket-server/_example_bitbucket_user_blueprint.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/_resources/_example_bitbucket_user_blueprint.mdx similarity index 100% rename from docs/build-your-software-catalog/custom-integration/webhook/examples/resources/bitbucket-server/_example_bitbucket_user_blueprint.mdx rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/_resources/_example_bitbucket_user_blueprint.mdx diff --git a/docs/build-your-software-catalog/custom-integration/webhook/examples/resources/bitbucket-server/_example_bitbucket_webhook_config.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/_resources/_example_bitbucket_webhook_config.mdx similarity index 100% rename from docs/build-your-software-catalog/custom-integration/webhook/examples/resources/bitbucket-server/_example_bitbucket_webhook_config.mdx rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/_resources/_example_bitbucket_webhook_config.mdx diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/_templates/_ocean_saas_installation.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/_templates/_ocean_saas_installation.mdx new file mode 100644 index 0000000000..e849355905 --- /dev/null +++ b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/_templates/_ocean_saas_installation.mdx @@ -0,0 +1,94 @@ +import BetaFeatureNotice from "/docs/generalTemplates/_beta_feature_notice.md"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; +import OceanSaasLimitations from "/src/components/ocean-saas-specifics/limitations.jsx"; +import { OceanSaasLiveEventsDescription, OceanSaasLiveEventsTriggersManual, liveEvents } from "/src/components/ocean-saas-specifics/live-events.jsx"; + +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

+ + + +
+ Supported live event triggers + {liveEvents[props.integration] && + + } +
+ +:::tip Self-hosted installation +Alternatively, you can install the integration using the [Real-time (self-hosted)](?installation-methods=real-time-self-hosted#setup) method to update Port in real time using webhooks. +::: + +

Installation

+ +To install, follow these steps: + +1. Go to the [Data sources](https://app.getport.io/settings/data-sources) page of your portal. + +2. Click on the `+ Data source` button in the top-right corner. + +3. Click on the relevant integration in the list. + +4. Under `Select your installation method`, choose `Hosted by Port`. + +5. Configure the `integration settings` and `application 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](/build-your-software-catalog/customize-integrations/configure-mapping#test-your-mapping---jq-playground), they allow you to run your `jq` 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](/sso-rbac/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](/sso-rbac/port-secrets/#usage). + +

Limitations

+ + + + + +

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: + + + +``` +54.73.167.226 +63.33.143.237 +54.76.185.219 +``` + + +``` +3.234.37.33 +54.225.172.136 +3.225.234.99 +``` + + + + + +:::warning Bitbucket (Self-Hosted) version +You should toggle the `Bitbucket Is Version 8 Point 7 Or Older` option 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. +::: + diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/bitbucket-server.md b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/bitbucket-server.md new file mode 100644 index 0000000000..95a20972eb --- /dev/null +++ b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/bitbucket-server.md @@ -0,0 +1,1643 @@ +--- +sidebar_position: 1 +--- + +import Tabs from "@theme/Tabs" +import TabItem from "@theme/TabItem" +import PortTooltip from "/src/components/tooltip/tooltip.jsx" +import Prerequisites from "/docs/build-your-software-catalog/sync-data-to-catalog/templates/\_ocean_helm_prerequisites_block.mdx" +import AzurePremise from "/docs/build-your-software-catalog/sync-data-to-catalog/templates/\_ocean_azure_premise.mdx" +import HelmParameters from "/docs/build-your-software-catalog/sync-data-to-catalog/templates/\_ocean-advanced-parameters-helm.mdx" +import DockerParameters from "/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/_resources/_bitbucket_cloud_one_time_docker_parameters.mdx" +import AdvancedConfig from '/docs/generalTemplates/\_ocean_advanced_configuration_note.md' +import PortApiRegionTip from "/docs/generalTemplates/_port_region_parameter_explanation_template.md" +import OceanSaasInstallation from "./\_templates/_ocean_saas_installation.mdx" +import OceanRealtimeInstallation from "/docs/build-your-software-catalog/sync-data-to-catalog/templates/_ocean_realtime_installation.mdx" +import BitbucketProjectBlueprint from "/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/_resources/\_example_bitbucket_project_blueprint.mdx"; +import BitbucketUserBlueprint from "/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/_resources/\_example_bitbucket_user_blueprint.mdx"; +import BitbucketPullrequestBlueprint from "/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/_resources/\_example_bitbucket_pull_request_blueprint.mdx"; +import BitbucketRepositoryBlueprint from "/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/_resources/\_example_bitbucket_repository_blueprint.mdx"; +import BitbucketWebhookConfiguration from "/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/_resources/\_example_bitbucket_webhook_config.mdx"; +import BitbucketServerPythonScript from "/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/_resources/\_example_bitbucket_python_script.mdx"; + +# Bitbucket (self-hosted) + +Port's Bitbucket (Self-Hosted) integration allows you to model Bitbucket Server / Bitbucket Data Center resources in your software catalog and ingest data into them. + +**Note:** While Bitbucket Server has been [deprecated and replaced by Bitbucket Data Center](https://www.atlassian.com/blog/announcements/journey-to-cloud), they expose the same set of APIs and this integration covers both. + +:::info Bitbucket Self-Hosted +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](/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/bitbucket-cloud.md). +::: + + +## 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. + +- [Project](https://developer.atlassian.com/server/bitbucket/rest/v906/api-group-project/#api-api-latest-projects-get) +- [Repository](https://developer.atlassian.com/server/bitbucket/rest/v906/api-group-project/#api-api-latest-projects-projectkey-repos-get) +- [Pull Request](https://developer.atlassian.com/server/bitbucket/rest/v906/api-group-pull-requests/#api-api-latest-projects-projectkey-repos-repositoryslug-pull-requests-get) +- [User](https://developer.atlassian.com/server/bitbucket/rest/v906/api-group-permission-management/#api-api-latest-admin-users-get) + + +## Setup + + +Choose one of the following installation methods: + + + + + + + + + + + +Using this installation option means that the integration will be able to update Port in real time using webhooks. + +

Prerequisites

+ + + +For details about the available parameters for the installation, see the table below. + + + + + + + + + + + +To install the integration using ArgoCD: + +1. Create a `values.yaml` file in `argocd/my-ocean-bitbucket-server-integration` in your git repository with the content: + +:::note +Remember to replace the placeholder for `BITBUCKET_USERNAME`, `BITBUCKET_PASSWORD`, `BITBUCKET_BASE_URL`, `BITBUCKET_WEBHOOK_SECRET`, `BITBUCKET_IS_VERSION_8_POINT_7_OR_OLDER`. +::: + +```yaml showLineNumbers +initializePortResources: true +scheduledResyncInterval: 120 +integration: + identifier: my-ocean-bitbucket-server-integration + type: bitbucket-server + eventListener: + type: POLLING + config: + // highlight-start + bitbucketBaseUrl: BITBUCKET_BASE_URL + bitbucketUsername: BITBUCKET_USERNAME + bitbucketIsVersion8Point7OrOlder: BITBUCKET_IS_VERSION_8_POINT_7_OR_OLDER + // highlight-end + secrets: + // highlight-start + bitbucketPassword: BITBUCKET_PASSWORD + bitbucketWebhookSecret: BITBUCKET_WEBHOOK_SECRET + // highlight-end +``` + +
+ +1. Install the `my-ocean-bitbucket-server-integration` ArgoCD Application by creating the following `my-ocean-bitbucket-server-integration.yaml` manifest: + +:::note Replace placeholders + +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](https://argo-cd.readthedocs.io/en/stable/user-guide/multiple_sources/#helm-value-files-from-external-git-repository). + +::: + +
+ ArgoCD Application + +```yaml showLineNumbers +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 + // highlight-start + 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 + // highlight-end + targetRevision: main + ref: values + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true +``` + + + +
+
+ +1. Apply your application manifest with `kubectl`: + +```bash +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`) | ❌ | + + +**Note:** You should set the `integration.config.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.7 and above. + + +
+ + + +
+ + + +This workflow/pipeline will run the Bitbucket (Self-Hosted) integration once and then exit, this is useful for **scheduled** ingestion of data. + +:::warning Real-time updates +If you want the integration to update Port in real time using webhooks you should use the [Real-time (self-hosted)](?installation-methods=real-time-self-hosted#setup) installation option. +::: + + + + +Make sure to configure the following [Github Secrets](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions): + +| Parameter | Description | Example | Required | +|-----------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|----------| +| `port_client_id` | Your Port client ([How to get the credentials](https://docs.port.io/build-your-software-catalog/custom-integration/api/#find-your-port-credentials)) id | | ✅ | +| `port_client_secret` | Your Port client ([How to get the credentials](https://docs.port.io/build-your-software-catalog/custom-integration/api/#find-your-port-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](https://ocean.getport.io/develop-an-integration/integration-configuration/#initializeportresources---initialize-port-resources) | | ❌ | +| `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 (Self-Hosted) | https://my-ocean-integration.com | ❌ | +
+ +:::tip Ocean Sail Github Action +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](https://github.com/marketplace/actions/ocean-sail) +::: + +
+ +Here is an example for `bitbucket-server-integration.yml` workflow file: + +```yaml showLineNumbers +name: Bitbucket (Self-Hosted) 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 }} +``` + +**Note:** You should set the `bitbucket_is_version_8_point_7_or_older` 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.7 and above. + +
+ + +:::tip Tip for Jenkins agent +Your Jenkins agent should be able to run docker commands. +::: + + +Make sure to configure the following [Jenkins Credentials](https://www.jenkins.io/doc/book/using/using-credentials/) of `Secret Text` type: + + + +
+ +Here is an example for `Jenkinsfile` groovy pipeline file: + +```yml showLineNumbers +pipeline { + agent any + + stages { + stage('Run Bitbucket Self-Hosted 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 $? + ''') + } + } + } + } + } +} +``` + +**Note:** You should set the `OCEAN__INTEGRATION__CONFIG__BITBUCKET_IS_VERSION_8_POINT_7_OR_OLDER` 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.7 and above. + +
+ + + + + +
+ +Here is an example for `bitbucket-server-integration.yml` pipeline file: + +```yaml showLineNumbers +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" +``` + +**Note:** You should set the `OCEAN__INTEGRATION__CONFIG__BITBUCKET_IS_VERSION_8_POINT_7_OR_OLDER` 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.7 and above. + +
+ + +Make sure to [configure the following GitLab variables](https://docs.gitlab.com/ee/ci/variables/#for-a-project): + + + +
+ + +Here is an example for `.gitlab-ci.yml` pipeline file: + +```yaml showLineNumbers +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"' +``` + +**Note:** You should set the `OCEAN__INTEGRATION__CONFIG__BITBUCKET_IS_VERSION_8_POINT_7_OR_OLDER` 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.7 and above. + +
+ +
+ + + + + +
+ + + +
+ + + +## Configuration + +Port integrations use a [YAML mapping block](/build-your-software-catalog/customize-integrations/configure-mapping#configuration-structure) to ingest data from the third-party api into Port. + +The mapping makes use of the [JQ JSON processor](https://stedolan.github.io/jq/manual/) 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](https://app.getport.io/settings/data-sources). 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 + +```json showLineNumbers +{ + "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 + +```yaml showLineNumbers +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 + +```json showLineNumbers +{ + "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 + +```yaml showLineNumbers +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 + +```json showLineNumbers +{ + "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 + +```yaml showLineNumbers +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 + +```json showLineNumbers +{ + "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 + +```yaml showLineNumbers +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 (Self-Hosted). 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 (Self-Hosted): + +
+ Project response data + +```json showLineNumbers +{ + "key": "PROJ", + "id": 1, + "name": "Project", + "public": false, + "type": "NORMAL", + "links": { + "self": [ + { + "href": "http://localhost:7990/projects/PROJ" + } + ] + } +} +``` + +
+ +
+ Repository response data + +```json showLineNumbers +{ + "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 + +```json showLineNumbers +{ + "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 + +```json showLineNumbers +{ + "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 + +```json showLineNumbers +{ + "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 + +```json showLineNumbers +{ + "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 + +```json showLineNumbers +{ + "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 + +```json showLineNumbers +{ + "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" +} +``` + +
+ + +## GitOps +The Bitbucket (Self-Hosted) Ocean integration by itself 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](gitops.md) installation method. + +## Alternative installation via webhooks + +While the Ocean integration described above is the recommended installation method, you may prefer to use a webhook to ingest users, projects, repositories and pull request entities from Bitbucket (Self-Hosted). If so, use the following instructions: + +**Note** that when using this method, data will be ingested into Port only when the webhook is triggered. + +
+Webhook installation (click to expand) + +

Port configuration

+ +Create the following blueprint definitions: + +
+Bitbucket project blueprint + + + +
+ +
+Bitbucket user blueprint + + + +
+ +
+Bitbucket repository blueprint + + + +
+ +
+Bitbucket pull request blueprint + + + +
+ +:::tip Blueprint Properties +You may modify the properties in your blueprints depending on what you want to track in your Bitbucket account. +::: + +

Let's test it

+ +This section includes a sample webhook event sent from Bitbucket when a pull request is merged. In addition, it includes the entity created from the event based on the webhook configuration provided in the previous section. + +

Payload

+ +Here is an example of the payload structure sent to the webhook URL when a Bitbucket pull request is merged: + +
+ Webhook event payload + +```json showLineNumbers +{ + "body": { + "eventKey": "pr:merged", + "date": "2023-11-16T11:03:42+0000", + "actor": { + "name": "admin", + "emailAddress": "username@gmail.com", + "active": true, + "displayName": "Test User", + "id": 2, + "slug": "admin", + "type": "NORMAL", + "links": { + "self": [ + { + "href": "http://myhost:7990/users/admin" + } + ] + } + }, + "pullRequest": { + "id": 2, + "version": 2, + "title": "lint code", + "description": "here is the description", + "state": "MERGED", + "open": false, + "closed": true, + "createdDate": 1700132280533, + "updatedDate": 1700132622026, + "closedDate": 1700132622026, + "fromRef": { + "id": "refs/heads/dev", + "displayId": "dev", + "latestCommit": "9e08604e14fa72265d65696608725c2b8f7850f2", + "type": "BRANCH", + "repository": { + "slug": "data-analyses", + "id": 1, + "name": "data analyses", + "description": "This is for my repository and all the blah blah blah", + "hierarchyId": "24cfae4b0dd7bade7edc", + "scmId": "git", + "state": "AVAILABLE", + "statusMessage": "Available", + "forkable": true, + "project": { + "key": "MOPP", + "id": 1, + "name": "My On Prem Project", + "description": "On premise test project is sent to us for us", + "public": false, + "type": "NORMAL", + "links": { + "self": [ + { + "href": "http://myhost:7990/projects/MOPP" + } + ] + } + }, + "public": false, + "archived": false, + "links": { + "clone": [ + { + "href": "ssh://git@myhost:7999/mopp/data-analyses.git", + "name": "ssh" + }, + { + "href": "http://myhost:7990/scm/mopp/data-analyses.git", + "name": "http" + } + ], + "self": [ + { + "href": "http://myhost:7990/projects/MOPP/repos/data-analyses/browse" + } + ] + } + } + }, + "toRef": { + "id": "refs/heads/main", + "displayId": "main", + "latestCommit": "e461aae894b6dc951f405dca027a3f5567ea6bee", + "type": "BRANCH", + "repository": { + "slug": "data-analyses", + "id": 1, + "name": "data analyses", + "description": "This is for my repository and all the blah blah blah", + "hierarchyId": "24cfae4b0dd7bade7edc", + "scmId": "git", + "state": "AVAILABLE", + "statusMessage": "Available", + "forkable": true, + "project": { + "key": "MOPP", + "id": 1, + "name": "My On Prem Project", + "description": "On premise test project is sent to us for us", + "public": false, + "type": "NORMAL", + "links": { + "self": [ + { + "href": "http://myhost:7990/projects/MOPP" + } + ] + } + }, + "public": false, + "archived": false, + "links": { + "clone": [ + { + "href": "ssh://git@myhost:7999/mopp/data-analyses.git", + "name": "ssh" + }, + { + "href": "http://myhost:7990/scm/mopp/data-analyses.git", + "name": "http" + } + ], + "self": [ + { + "href": "http://myhost:7990/projects/MOPP/repos/data-analyses/browse" + } + ] + } + } + }, + "locked": false, + "author": { + "user": { + "name": "admin", + "emailAddress": "username@gmail.com", + "active": true, + "displayName": "Test User", + "id": 2, + "slug": "admin", + "type": "NORMAL", + "links": { + "self": [ + { + "href": "http://myhost:7990/users/admin" + } + ] + } + }, + "role": "AUTHOR", + "approved": false, + "status": "UNAPPROVED" + }, + "reviewers": [], + "participants": [], + "properties": { + "mergeCommit": { + "displayId": "1cbccf99220", + "id": "1cbccf99220b23f89624c7c604f630663a1aaf8e" + } + }, + "links": { + "self": [ + { + "href": "http://myhost:7990/projects/MOPP/repos/data-analyses/pull-requests/2" + } + ] + } + } + }, + "headers": { + "X-Forwarded-For": "10.0.148.57", + "X-Forwarded-Proto": "https", + "X-Forwarded-Port": "443", + "Host": "ingest.getport.io", + "X-Amzn-Trace-Id": "Self=1-6555f719-267a0fce1e7a4d8815de94f7;Root=1-6555f719-1906872f41621b17250bb83a", + "Content-Length": "2784", + "User-Agent": "Atlassian HttpClient 3.0.4 / Bitbucket-8.15.1 (8015001) / Default", + "Content-Type": "application/json; charset=UTF-8", + "accept": "*/*", + "X-Event-Key": "pr:merged", + "X-Hub-Signature": "sha256=bf366faf8d8c41a4af21d25d922b87c3d1d127b5685238b099d2f311ad46e978", + "X-Request-Id": "d5fa6a16-bb6c-40d6-9c50-bc4363e79632", + "via": "HTTP/1.1 AmazonAPIGateway", + "forwarded": "for=154.160.30.235;host=ingest.getport.io;proto=https" + }, + "queryParams": {} +} +``` + +
+ + +
+ Mapping result + +```json showLineNumbers +{ + "identifier":"2", + "title":"lint code", + "blueprint":"bitbucketPullrequest", + "properties":{ + "created_on":"2023-11-16T10:58:00Z", + "updated_on":"2023-11-16T11:03:42Z", + "merge_commit":"9e08604e14fa72265d65696608725c2b8f7850f2", + "state":"MERGED", + "owner":"Test User", + "link":"http://myhost:7990/projects/MOPP/repos/data-analyses/pull-requests/2", + "destination":"main", + "source":"dev", + "participants":[], + "reviewers":[] + }, + "relations":{ + "repository":"data-analyses" + }, + "filter":true +} +``` +
+ +

Import Bitbucket historical issues

+ +In this example you are going to use the provided Python script to set up webhooks and fetch data from the Bitbucket Server / Bitbucket Data Center API and ingest it to Port. + +

Prerequisites

+ +This example utilizes the [blueprint](#port-configuration) definition from the previous section. + +In addition, provide the following environment variables: + +- `PORT_CLIENT_ID` - Your Port client id +- `PORT_CLIENT_SECRET` - Your Port client secret +- `BITBUCKET_HOST` - Bitbucket Server / Bitbucket Data Center host such as `http://localhost:7990` +- `BITBUCKET_USERNAME` - Bitbucket username to use when accessing the Bitbucket resources +- `BITBUCKET_PASSWORD` - Bitbucket account password +- `BITBUCKET_PROJECTS_FILTER` - An optional comma separated list of Bitbucket projects to filter. If not provided, all projects will be fetched. +- `WEBHOOK_SECRET` - An optional secret to use when creating a webhook in Port. If not provided, `bitbucket_webhook_secret` will be used. +- `PORT_API_URL` - An optional variable that defaults to the EU Port API `https://api.getport.io/v1`. For US organizations use `https://api.us.getport.io/v1` instead. +- `IS_VERSION_8_7_OR_OLDER` - An optional variable that specifies whether the Bitbucket version is older than 8.7. This setting determines if webhooks should be created at the repository level (for older versions `<=8.7`) or at the project level (for newer versions `>=8.8`). +- `PULL_REQUEST_STATE` - An optional variable to specify the state of Bitbucket pull requests to be ingested. Accepted values are `"ALL"`, `"OPEN"`, `"MERGED"`, or `"DECLINED"`. If not specified, the default value is `OPEN`. + +:::tip Webhook Configuration +This app will automatically set up a webhook that allows Bitbucket to send events to Port. To understand more about how Bitbucket sends event payloads via webhooks, you can refer to [this documentation](https://confluence.atlassian.com/bitbucketserver/event-payload-938025882.html). + +Ensure that the Bitbucket credentials you use have `PROJECT_ADMIN` permissions to successfully configure the webhook. For more details on the necessary permissions and setup, see the [official Bitbucket documentation](https://developer.atlassian.com/server/bitbucket/rest/v910/api-group-project/#api-api-latest-projects-projectkey-webhooks-post). +::: + + +Find your Port credentials using this [guide](https://docs.port.io/build-your-software-catalog/custom-integration/api/#find-your-port-credentials) + + +Use the following Python script to set up webhook and ingest historical Bitbucket users, projects, repositories and pull requests into port: + +
+Bitbucket Python script + +:::tip Latest Version +You can pull the latest version of this code by cloning this [repository](https://github.com/port-labs/bitbucket-workspace-data/) +::: + + + +
+ +
+Bitbucket webhook configuration + + + +
+ +Done! you are now able to import historical users, projects, repositories and pull requests from Bitbucket into Port and any change that happens to your project, repository or pull requests in Bitbucket will trigger a webhook event to the webhook URL provided by Port. Port will parse the events and objects according to the mapping and update the catalog entities accordingly. + +
\ No newline at end of file diff --git a/docs/build-your-software-catalog/custom-integration/webhook/examples/bitbucket-server/gitops.md b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/gitops.md similarity index 88% rename from docs/build-your-software-catalog/custom-integration/webhook/examples/bitbucket-server/gitops.md rename to docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/gitops.md index 117023578d..7d89c426d7 100644 --- a/docs/build-your-software-catalog/custom-integration/webhook/examples/bitbucket-server/gitops.md +++ b/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/gitops.md @@ -1,5 +1,5 @@ --- -sidebar_position: 1 +sidebar_position: 2 --- import Tabs from "@theme/Tabs" @@ -9,9 +9,9 @@ import TabItem from "@theme/TabItem" Port's Bitbucket (Self-Hosted) makes it possible to manage Port entities with a GitOps approach, making your code repositories into the source of truth for the various infrastructure assets you want to manage. -## 💡 Bitbucket (Self-Hosted) GitOps common use cases +## 💡 Bitbucket GitOps common use cases -- Use Bitbucket server as the source-of-truth for your **microservices**, **packages**, **libraries** and other software catalog assets. +- Use Bitbucket (Self-Hosted) as the source-of-truth for your **microservices**, **packages**, **libraries** and other software catalog assets. - Allow developers to keep the catalog up-to-date, by making updates to files in their Git repositories. - Create a standardized way to document software catalog assets in your organization. @@ -36,7 +36,7 @@ root The `port.yaml` file can specify one or more Port entities that will be ingested to Port, and any change made to the `port.yaml` file will also be reflected inside Port. -This configuration turns your Bitbucket server repositories to the source-of-truth for the software catalog. +This configuration turns your Bitbucket (Self-Hosted) repositories to the source-of-truth for the software catalog. ### GitOps port.yaml file @@ -109,19 +109,19 @@ The `port.yaml` file has the following structure: To implement GitOps with Bitbucket (Self-Hosted), you can use the provided Python script that will scan your repositories for `port.yaml` files and create or update entities in Port accordingly. -### Prerequisites +

Prerequisites

To use the GitOps functionality, you need to provide the following environment variables: - `PORT_CLIENT_ID` - Your Port client id - `PORT_CLIENT_SECRET` - Your Port client secret -- `BITBUCKET_HOST` - Bitbucket server host such as `http://localhost:7990` +- `BITBUCKET_HOST` - Bitbucket (Self-Hosted) host such as `http://localhost:7990` - `BITBUCKET_USERNAME` - Bitbucket username to use when accessing the Bitbucket resources - `BITBUCKET_PASSWORD` - Bitbucket account password - `BITBUCKET_PROJECTS_FILTER` - An optional comma separated list of Bitbucket projects to filter. If not provided, all projects will be fetched. - `PORT_API_URL` - An optional variable that defaults to the EU Port API `https://api.getport.io/v1`. For US organizations use `https://api.us.getport.io/v1` instead. -### Python Script +

Python script

Here's a Python script that you can use to implement GitOps with Bitbucket (Self-Hosted): @@ -415,18 +415,18 @@ if __name__ == "__main__": -### Running the Script +

Running the script

-You can run this script periodically (e.g., using a cron job or CI/CD pipeline) to scan your Bitbucket Server repositories for `port.yaml` files and create or update entities in Port accordingly. +You can run this script periodically (e.g., using a cron job or CI/CD pipeline) to scan your Bitbucket (Self-Hosted) repositories for `port.yaml` files and create or update entities in Port accordingly. For example, you can create a GitHub Actions workflow that runs this script on a schedule: :::info Host accessibility -If you're running this script using GitHub Actions or any other external CI/CD service, your Bitbucket Server host must be accessible over the internet. If your Bitbucket Server is deployed in a private network or behind a firewall, you'll need to ensure it's properly exposed or consider running the script from a machine within the same network that has access to both the Bitbucket Server and the internet. +If you're running this script using GitHub Actions or any other external CI/CD service, your Bitbucket (Self-Hosted) host must be accessible over the internet. If your Bitbucket (Self-Hosted) is deployed in a private network or behind a firewall, you'll need to ensure it's properly exposed or consider running the script from a machine within the same network that has access to both the Bitbucket (Self-Hosted) and the internet. ::: ```yaml showLineNumbers -name: Bitbucket Server GitOps +name: Bitbucket (Self-Hosted) GitOps on: schedule: @@ -485,11 +485,11 @@ This will create or update a microservice entity in Port with the specified prop ## Limitations -The GitOps script has a limitation regarding entity deletion - when an entity is removed from the `port.yaml` file, it will not be automatically deleted from your Port catalog. The script only handles creation and updates of entities that are explicitly defined in the `port.yaml` files. +- The GitOps script has a limitation regarding entity deletion - when an entity is removed from the `port.yaml` file, it will not be automatically deleted from your Port catalog. The script only handles creation and updates of entities that are explicitly defined in the `port.yaml` files. To remove entities that are no longer needed in your catalog, you will need to delete them manually through Port's UI or API. -To remove entities that are no longer needed in your catalog, you will need to delete them manually through Port's UI or API. +- The Bitbucket (Self-Hosted) Ocean integration by itself does not support GitOps yet. This capability is planned for a future release and is WIP. GitOps support is provided in this guide instead. ## Conclusion -Using GitOps with Bitbucket Server allows you to manage your Port entities directly from your code repositories, making it easier to keep your software catalog up-to-date and accurate. By adding a `port.yaml` file to your repositories, you can define the entities that should be created or updated in Port, and the provided Python script will handle the synchronization for you. +Using GitOps with Bitbucket (Self-Hosted) allows you to manage your Port entities directly from your code repositories, making it easier to keep your software catalog up-to-date and accurate. By adding a `port.yaml` file to your repositories, you can define the entities that should be created or updated in Port, and the provided Python script will handle the synchronization for you. diff --git a/docs/guides/all/__import-backstage-resources.md b/docs/guides/all/__import-backstage-resources.md index 6f549043bb..a0d374017d 100644 --- a/docs/guides/all/__import-backstage-resources.md +++ b/docs/guides/all/__import-backstage-resources.md @@ -56,4 +56,4 @@ Once all of the data has been imported to Port, you will likely want to start ma This will download all the specification files to your local machine. You can then push them to your GitOps repository and begin managing them from there. -To learn more about managing your Port entities using GitOps, refer to the [GitHub](/build-your-software-catalog/sync-data-to-catalog/git/github/gitops/gitops.md) and [Bitbucket](/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/gitops/gitops.md) GitOps pages. +To learn more about managing your Port entities using GitOps, refer to the [GitHub](/build-your-software-catalog/sync-data-to-catalog/git/github/gitops/gitops.md) and [Bitbucket](/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/gitops/gitops.md) GitOps pages. diff --git a/docs/integrations-index.md b/docs/integrations-index.md index b57e6b3856..e1fe7f911c 100644 --- a/docs/integrations-index.md +++ b/docs/integrations-index.md @@ -47,11 +47,16 @@ This page contains a list of Port's available integrations, organized by the pla ### Bitbucket -- [Bitbucket app](/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket.md) -- [BitBucket GitOps](/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/gitops/gitops.md) -- [Sync repositories, file contents, pull-requests, monorepos and more](/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/examples.md) +- [Bitbucket App (Deprecated)](/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/bitbucket-app.md) + - [GitOps](/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/gitops/gitops.md) + - [Sync repositories, file contents, pull-requests, monorepos and more](/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/examples.md) +- [Bitbucket Cloud](/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/bitbucket-cloud.md) + - [GitOps](/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/gitops/gitops.md) + - [Sync repositories, file contents, pull-requests, monorepos and more](/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud/examples.md) + - [Bitbucket scaffolder](/guides/all/scaffold-bitbucket-using-cookiecutter.md) -- [Webhook integration between Bitbucket (self-hosted) server and Port](/build-your-software-catalog/custom-integration/webhook/examples/bitbucket-server/bitbucket-server.md) +- [Bitbucket Server Integration](/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/bitbucket-server.md) +- [Bitbucket Server GitOps with webhooks](/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-server/gitops.md) ### Azure DevOps diff --git a/docs/security.md b/docs/security.md index 356c3e7e81..4ca2958c2f 100644 --- a/docs/security.md +++ b/docs/security.md @@ -149,7 +149,7 @@ No matter what backend you choose to trigger self-service actions or automations Port provides native applications for GitHub and Bitbucket which seamlessly integrate with the Git providers to ingest information and keep an up-to-date catalog available in Port. These integrations use OAuth 2.0 for authentication and permissions to your Git provider. -As part of the installation of Port's Git provider apps, the apps gain a limited set of permissions ([GitHub](/docs/build-your-software-catalog/sync-data-to-catalog/git/github/github.md#permissions), [Bitbucket](/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket.md#permissions)). In addition, it is possible to selectively authorize access to a limited set of repositories. +As part of the installation of Port's Git provider apps, the apps gain a limited set of permissions ([GitHub](/docs/build-your-software-catalog/sync-data-to-catalog/git/github/github.md#permissions), [Bitbucket](/docs/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-app/bitbucket-app.md#permissions)). In addition, it is possible to selectively authorize access to a limited set of repositories. By default the Git integrations will not ingest any source code, and will only search for `README.md` files specifically. It is possible to configure the apps to not ingest any source code files at all, or to ingest additional files that are relevant to your use case. diff --git a/src/components/IntegrationsTable/integrations-data.js b/src/components/IntegrationsTable/integrations-data.js index 5557e00339..8aa07b0b0a 100644 --- a/src/components/IntegrationsTable/integrations-data.js +++ b/src/components/IntegrationsTable/integrations-data.js @@ -19,7 +19,7 @@ export const integrations = [ category: 'git', icon: '/img/guides/icons/BitBucket.svg', darkIcon: '/img/guides/icons/dark/BitBucket.svg', - docsUrl: '/build-your-software-catalog/sync-data-to-catalog/git/bitbucket', + docsUrl: '/build-your-software-catalog/sync-data-to-catalog/git/bitbucket/bitbucket-cloud', }, { name: 'AzureDevops', diff --git a/src/components/ocean-saas-specifics/live-events.jsx b/src/components/ocean-saas-specifics/live-events.jsx index af6e5a5067..a5ee9018e1 100644 --- a/src/components/ocean-saas-specifics/live-events.jsx +++ b/src/components/ocean-saas-specifics/live-events.jsx @@ -167,6 +167,26 @@ export const liveEvents = { \n- git.pullrequest.created \ \n- git.pullrequest.updated \ \n- git.push', + BitbucketServer: + '**Pull Request:** \ + \n- pr:modified \ + \n- pr:opened \ + \n- pr:merged \ + \n- pr:reviewer:updated \ + \n- pr:declined \ + \n- pr:deleted \ + \n- pr:comment:deleted \ + \n- pr:from_ref_updated \ + \n- pr:comment:edited \ + \n- pr:reviewer:unapproved \ + \n- pr:reviewer:needs_work \ + \n- pr:reviewer:approved \ + \n- pr:comment:added \ + \n\n**Repository:** \ + \n- repo:modified \ + \n- repo:refs_changed \ + \n\n**Project:** \ + \n- project:modified', }; export const OceanSaasLiveEventsTriggersOAuth = ({ id, isOAuth = false }) => {