Skip to content

Commit d27da7d

Browse files
alexcoderabbitaicoderabbitai[bot]github-actions[bot]
authored
add bitbucket docs (#176)
* add bitbucket docs * Update docs/self-hosted/bitbucket.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * 🎨 pnpm run lint:fix [dependabot skip] * fix bitbucket name * 🎨 pnpm run lint:fix [dependabot skip] * add to platform list * 🎨 pnpm run lint:fix [dependabot skip] * fixing platforms page --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent beb7b38 commit d27da7d

File tree

2 files changed

+129
-13
lines changed

2 files changed

+129
-13
lines changed

docs/platforms/platforms.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,30 @@ CodeRabbit supports various Git platforms to provide code review for your reposi
1111

1212
| Host | Support |
1313
| ------------------------ | ---------------------------------------- |
14-
| GitHub.com | [Supported][login] |
14+
| GitHub.com | [Supported](github-com.md) |
1515
| GitHub Enterprise Server | [Supported](github-enterprise-server.md) |
16+
| GitHub Self Hosted | [Supported](../self-hosted/github.md) |
1617

1718
## GitLab
1819

19-
| Host | Support |
20-
| ------------------- | ---------------------------------- |
21-
| GitLab.com | [Supported](gitlab-com.md) |
22-
| GitLab Self Managed | [Supported](self-hosted-gitlab.md) |
20+
| Host | Support |
21+
| ------------------- | ------------------------------------- |
22+
| GitLab.com | [Supported](gitlab-com.md) |
23+
| GitLab Self Managed | [Supported](self-hosted-gitlab.md) |
24+
| GitLab Self Hosted | [Supported](../self-hosted/gitlab.md) |
2325

2426
## Azure DevOps
2527

26-
| Host | Support |
27-
| ------------------- | ---------------------------- |
28-
| Azure DevOps | [Supported](azure-devops.md) |
29-
| Azure DevOps Server | [Supported] |
28+
| Host | Support |
29+
| ------------------- | ------------------------------------------- |
30+
| Azure DevOps | [Supported](azure-devops.md) |
31+
| Azure DevOps Server | [Supported](../self-hosted/azure-devops.md) |
3032

3133
## Bitbucket
3234

33-
| Host | Support |
34-
| --------------------- | ----------- |
35-
| Cloud | Coming soon |
36-
| Bitbucket Data Center | [Supported] |
35+
| Host | Support |
36+
| -------------------- | ---------------------------------------- |
37+
| Bitbucket Datacenter | [Supported](../self-hosted/bitbucket.md) |
38+
| Bitbucket Cloud | Coming soon |
3739

3840
[login]: https://app.coderabbit.ai/login

docs/self-hosted/bitbucket.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
---
2+
title: Use Self-Hosted CodeRabbit With Bitbucket Datacenter
3+
sidebar_label: Bitbucket Datacenter
4+
description: Instructions to self-host CodeRabbit and integrate it with Bitbucket Datacenter.
5+
sidebar_position: 4
6+
---
7+
8+
:::note
9+
10+
The self-hosted option is only available for CodeRabbit Enterprise customers with 500 user seats or more. Please contact [CodeRabbit Sales](mailto:sales@coderabbit.ai) to learn more about the CodeRabbit Enterprise plan.
11+
12+
:::
13+
14+
## Create a Bitbucket User
15+
16+
- **Username**: Set the username to "CodeRabbit" for easier identification (optional).
17+
- **Profile Image**: Use the CodeRabbitAI logo for the user image (optional).
18+
19+
## Add User to Projects
20+
21+
Add the CodeRabbit user to each project where you want CodeRabbit to post reviews, with permissions to:
22+
23+
- Post reviews
24+
- Open pull requests
25+
26+
## Create a Personal Access Token for CodeRabbit user
27+
28+
Generate a personal access token for the CodeRabbit user to be added in the `.env` file as `BITBUCKET_SERVER_BOT_TOKEN`.
29+
30+
## Add a webhook to each project
31+
32+
1. **Navigate to Webhook Settings**: Go to the repository settings and locate the webhooks configuration page.
33+
2. **Configure Events**: Enable the following Pull Request events:
34+
- "Opened"
35+
- "Modified"
36+
- "Comment Added"
37+
3. **Add Webhook URL**: Enter the URL pointing to the CodeRabbit service, followed by `/bitbucket_server_webhooks` (e.g., `http://127.0.0.1:8080/bitbucket_server_webhooks`).
38+
39+
## Prepare an `.env` file
40+
41+
Create an `.env` file with the following content:
42+
43+
```bash
44+
# if using OpenAI
45+
LLM_PROVIDER=openai
46+
LLM_TIMEOUT=360000
47+
OPENAI_API_KEYS=<openai-key>
48+
OPENAI_BASE_URL=[<openai-base-url>]
49+
OPENAI_ORG_ID=[<openai-org-id>]
50+
OPENAI_PROJECT_ID=[<openai-project-id>]
51+
52+
# if using Azure OpenAI
53+
LLM_PROVIDER=azure-openai
54+
LLM_TIMEOUT=360000
55+
AZURE_OPENAI_ENDPOINT=<azure-openai-endpoint>
56+
AZURE_OPENAI_API_KEY=<key>
57+
AZURE_GPT4OMINI_DEPLOYMENT_NAME=<gpt-4o-mini-deployment-name>
58+
AZURE_GPT4O_DEPLOYMENT_NAME=<gpt-4o-deployment-name> # modelVersion: 2024-08-06
59+
AZURE_O1_MINI_DEPLOYMENT_NAME=[<o1-mini-deployment-name>] # Optional
60+
AZURE_O1_DEPLOYMENT_NAME=[<o1-preview-deployment-name>] # Optional: Provides best reviews but very expensive
61+
AZURE_GPT4TURBO_DEPLOYMENT_NAME=[<gpt-4-turbo-deployment-name>] # Optional: modelVersion: turbo-2024-04-09
62+
63+
# System Configuration
64+
TEMP_PATH=/cache
65+
AST_GREP_RULES_PATH=/home/jailuser/ast-grep-rules
66+
AST_GREP_ESSENTIALS=ast-grep-essentials
67+
SELF_HOSTED=bitbucket-server
68+
BITBUCKET_SERVER_URL=<bitbucket-server-url>/rest
69+
BITBUCKET_SERVER_WEBHOOK_SECRET=<webhook-secret>
70+
BITBUCKET_SERVER_BOT_TOKEN=<personal-access-token>
71+
BITBUCKET_SERVER_BOT_USERNAME=<bot-user-username>
72+
CODERABBIT_LICENSE_KEY=<license-key>
73+
CODERABBIT_API_KEY=[<coderabbitai-api-key>]
74+
75+
# Optional Features
76+
ENABLE_LEARNINGS=[true]
77+
ENABLE_METRICS=[true]
78+
JIRA_HOST=[<jira-host-url>]
79+
JIRA_PAT=[<jira-personal-access-token>]
80+
LINEAR_PAT=[<linear-personal-access-token>]
81+
```
82+
83+
:::note
84+
85+
- If you are using Azure OpenAI, verify that the model deployment names are in the .env file.
86+
Values marked with [] are optional and can be omitted if the feature is not needed.
87+
- You can generate `CODERABBIT_API_KEY` from CodeRabbit UI -> Organizations Settings -> API Keys.
88+
89+
:::
90+
91+
## Pull the CodeRabbit Docker image
92+
93+
Authenticate and pull the Docker image using the provided credentials file:
94+
95+
```bash
96+
cat coderabbit.json | docker login -u _json_key --password-stdin us-docker.pkg.dev
97+
docker pull us-docker.pkg.dev/coderabbitprod/self-hosted/coderabbit-agent:latest
98+
```
99+
100+
### Verify the image is up
101+
102+
You can query `/health` endpoint to verify that the coderabbit-agent service is up and running.
103+
104+
```bash
105+
curl 127.0.0.1:8080/health
106+
```
107+
108+
## Host the image
109+
110+
You can host the image on a server, serverless function, or container environment and expose port `8080`. Run the Docker image with the equivalent command on your chosen platform, ensuring you replace the `.env` file path with the path to your actual `.env` file:
111+
112+
```bash
113+
docker run --env-file .env --publish 127.0.0.1:8080:8080 us-docker.pkg.dev/coderabbitprod/self-hosted/coderabbit-agent:latest
114+
```

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy