Skip to content

Commit 4c6636d

Browse files
committed
add docs for bitbucket and minor nits
1 parent bcb32cd commit 4c6636d

File tree

11 files changed

+530
-2
lines changed

11 files changed

+530
-2
lines changed

docs/docs.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
"docs/connections/overview",
3232
"docs/connections/github",
3333
"docs/connections/gitlab",
34+
"docs/connections/bitbucket-cloud",
35+
"docs/connections/bitbucket-server",
3436
"docs/connections/gitea",
3537
"docs/connections/gerrit",
3638
"docs/connections/request-new"
Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
---
2+
title: Linking code from Bitbucket Cloud
3+
sidebarTitle: Bitbucket Cloud
4+
---
5+
6+
import BitbucketToken from '/snippets/bitbucket-token.mdx';
7+
import BitbucketAppPassword from '/snippets/bitbucket-app-password.mdx';
8+
9+
## Examples
10+
11+
<AccordionGroup>
12+
<Accordion title="Sync individual repos">
13+
```json
14+
{
15+
"type": "bitbucket",
16+
"deploymentType": "cloud",
17+
"repos": [
18+
"myWorkspace/myRepo"
19+
]
20+
}
21+
```
22+
</Accordion>
23+
<Accordion title="Sync all repos in a workspace">
24+
```json
25+
{
26+
"type": "bitbucket",
27+
"deploymentType": "cloud",
28+
"workspaces": [
29+
"myWorkspace"
30+
]
31+
}
32+
```
33+
</Accordion>
34+
<Accordion title="Sync all repos in a project">
35+
```json
36+
{
37+
"type": "bitbucket",
38+
"deploymentType": "cloud",
39+
"project": [
40+
"myWorkspace/myRepo"
41+
]
42+
}
43+
```
44+
</Accordion>
45+
<Accordion title="Exclude repos from syncing">
46+
```json
47+
{
48+
"type": "bitbucket",
49+
"deploymentType": "cloud",
50+
// Include all repos in my-workspace...
51+
"workspaces": [
52+
"myWorkspace"
53+
],
54+
// ...except:
55+
"exclude": {
56+
// repos that are archived
57+
"archived": true,
58+
// repos that are forks
59+
"forks": true,
60+
// repos that match these glob patterns
61+
"repos": [
62+
"myWorkspace/repo1",
63+
"myWorkspace2/*"
64+
]
65+
}
66+
}
67+
```
68+
</Accordion>
69+
</AccordionGroup>
70+
71+
## Authenticating with Bitbucket Cloud
72+
73+
In order to index private repositories, you'll need to provide authentication credentials. You can do this using an `App Password` or an `Access Token`
74+
75+
<Tabs>
76+
<Tab title="App Password">
77+
Navigate to the [app password creation page](https://bitbucket.org/account/settings/app-passwords/) and create an app password. Ensure that it has the proper permissions for the scope
78+
of info you want to fetch (i.e. workspace, project, and/or repo level)
79+
![Bitbucket App Password Permissions](/images/bitbucket_app_password_perms.png)
80+
81+
Next, provide your username + app password pair to Sourcebot:
82+
83+
<BitbucketAppPassword />
84+
</Tab>
85+
<Tab title="Access Token">
86+
Create an access token for the desired scope (repo, project, or workspace). Visit the official [Bitbucket Cloud docs](https://support.atlassian.com/bitbucket-cloud/docs/access-tokens/)
87+
for more info.
88+
89+
Next, provide the access token to Sourcebot:
90+
91+
<BitbucketToken />
92+
</Tab>
93+
</Tabs>
94+
95+
96+
## Schema reference
97+
98+
<Accordion title="Reference">
99+
[schemas/v3/bitbucket.json](https://github.com/sourcebot-dev/sourcebot/blob/main/schemas/v3/bitbucket.json)
100+
101+
```json
102+
{
103+
"$schema": "http://json-schema.org/draft-07/schema#",
104+
"type": "object",
105+
"title": "BitbucketConnectionConfig",
106+
"properties": {
107+
"type": {
108+
"const": "bitbucket",
109+
"description": "Bitbucket configuration"
110+
},
111+
"user": {
112+
"type": "string",
113+
"description": "The username to use for authentication. Only needed if token is an app password."
114+
},
115+
"token": {
116+
"$ref": "./shared.json#/definitions/Token",
117+
"description": "An authentication token.",
118+
"examples": [
119+
{
120+
"secret": "SECRET_KEY"
121+
}
122+
]
123+
},
124+
"url": {
125+
"type": "string",
126+
"format": "url",
127+
"default": "https://api.bitbucket.org/2.0",
128+
"description": "Bitbucket URL",
129+
"examples": [
130+
"https://bitbucket.example.com"
131+
],
132+
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$"
133+
},
134+
"deploymentType": {
135+
"type": "string",
136+
"enum": ["cloud", "server"],
137+
"default": "cloud",
138+
"description": "The type of Bitbucket deployment"
139+
},
140+
"workspaces": {
141+
"type": "array",
142+
"items": {
143+
"type": "string"
144+
},
145+
"description": "List of workspaces to sync. Ignored if deploymentType is server."
146+
},
147+
"projects": {
148+
"type": "array",
149+
"items": {
150+
"type": "string"
151+
},
152+
"description": "List of projects to sync"
153+
},
154+
"repos": {
155+
"type": "array",
156+
"items": {
157+
"type": "string"
158+
},
159+
"description": "List of repos to sync"
160+
},
161+
"exclude": {
162+
"type": "object",
163+
"properties": {
164+
"archived": {
165+
"type": "boolean",
166+
"default": false,
167+
"description": "Exclude archived repositories from syncing."
168+
},
169+
"forks": {
170+
"type": "boolean",
171+
"default": false,
172+
"description": "Exclude forked repositories from syncing."
173+
},
174+
"repos": {
175+
"type": "array",
176+
"items": {
177+
"type": "string"
178+
},
179+
"examples": [
180+
[
181+
"cloud_workspace/repo1",
182+
"server_project/repo2"
183+
]
184+
],
185+
"description": "List of specific repos to exclude from syncing."
186+
}
187+
},
188+
"additionalProperties": false
189+
},
190+
"revisions": {
191+
"$ref": "./shared.json#/definitions/GitRevisions"
192+
}
193+
},
194+
"required": [
195+
"type"
196+
],
197+
"additionalProperties": false
198+
}
199+
```
200+
201+
</Accordion>
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
---
2+
title: Linking code from Bitbucket Data Center
3+
sidebarTitle: Bitbucket Data Center
4+
---
5+
6+
import BitbucketToken from '/snippets/bitbucket-token.mdx';
7+
import BitbucketAppPassword from '/snippets/bitbucket-app-password.mdx';
8+
9+
## Examples
10+
11+
<AccordionGroup>
12+
<Accordion title="Sync individual repos">
13+
```json
14+
{
15+
"type": "bitbucket",
16+
"deploymentType": "server",
17+
"url": "https://mybitbucketdeployment.com"
18+
"repos": [
19+
"myProject/myRepo"
20+
]
21+
}
22+
```
23+
</Accordion>
24+
<Accordion title="Sync all repos in a project">
25+
```json
26+
{
27+
"type": "bitbucket",
28+
"deploymentType": "server",
29+
"url": "https://mybitbucketdeployment.com"
30+
"projects": [
31+
"myProject"
32+
]
33+
}
34+
```
35+
</Accordion>
36+
<Accordion title="Exclude repos from syncing">
37+
```json
38+
{
39+
"type": "bitbucket",
40+
"deploymentType": "server",
41+
"url": "https://mybitbucketdeployment.com"
42+
// Include all repos in myProject...
43+
"projects": [
44+
"myProject"
45+
],
46+
// ...except:
47+
"exclude": {
48+
// repos that are archived
49+
"archived": true,
50+
// repos that are forks
51+
"forks": true,
52+
// repos that match these glob patterns
53+
"repos": [
54+
"myProject/repo1",
55+
"myProject2/*"
56+
]
57+
}
58+
}
59+
```
60+
</Accordion>
61+
</AccordionGroup>
62+
63+
## Authenticating with Bitbucket Data Center
64+
65+
In order to index private repositories, you'll need to provide an access token to Sourcebot.
66+
67+
Create an access token for the desired scope (repo, project, or workspace). Visit the official [Bitbucket Data Center docs](https://confluence.atlassian.com/bitbucketserver/http-access-tokens-939515499.html)
68+
for more info.
69+
70+
Next, provide the access token to Sourcebot:
71+
72+
<BitbucketToken />
73+
74+
75+
## Schema reference
76+
77+
<Accordion title="Reference">
78+
[schemas/v3/bitbucket.json](https://github.com/sourcebot-dev/sourcebot/blob/main/schemas/v3/bitbucket.json)
79+
80+
```json
81+
{
82+
"$schema": "http://json-schema.org/draft-07/schema#",
83+
"type": "object",
84+
"title": "BitbucketConnectionConfig",
85+
"properties": {
86+
"type": {
87+
"const": "bitbucket",
88+
"description": "Bitbucket configuration"
89+
},
90+
"user": {
91+
"type": "string",
92+
"description": "The username to use for authentication. Only needed if token is an app password."
93+
},
94+
"token": {
95+
"$ref": "./shared.json#/definitions/Token",
96+
"description": "An authentication token.",
97+
"examples": [
98+
{
99+
"secret": "SECRET_KEY"
100+
}
101+
]
102+
},
103+
"url": {
104+
"type": "string",
105+
"format": "url",
106+
"default": "https://api.bitbucket.org/2.0",
107+
"description": "Bitbucket URL",
108+
"examples": [
109+
"https://bitbucket.example.com"
110+
],
111+
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$"
112+
},
113+
"deploymentType": {
114+
"type": "string",
115+
"enum": ["cloud", "server"],
116+
"default": "cloud",
117+
"description": "The type of Bitbucket deployment"
118+
},
119+
"workspaces": {
120+
"type": "array",
121+
"items": {
122+
"type": "string"
123+
},
124+
"description": "List of workspaces to sync. Ignored if deploymentType is server."
125+
},
126+
"projects": {
127+
"type": "array",
128+
"items": {
129+
"type": "string"
130+
},
131+
"description": "List of projects to sync"
132+
},
133+
"repos": {
134+
"type": "array",
135+
"items": {
136+
"type": "string"
137+
},
138+
"description": "List of repos to sync"
139+
},
140+
"exclude": {
141+
"type": "object",
142+
"properties": {
143+
"archived": {
144+
"type": "boolean",
145+
"default": false,
146+
"description": "Exclude archived repositories from syncing."
147+
},
148+
"forks": {
149+
"type": "boolean",
150+
"default": false,
151+
"description": "Exclude forked repositories from syncing."
152+
},
153+
"repos": {
154+
"type": "array",
155+
"items": {
156+
"type": "string"
157+
},
158+
"examples": [
159+
[
160+
"cloud_workspace/repo1",
161+
"server_project/repo2"
162+
]
163+
],
164+
"description": "List of specific repos to exclude from syncing."
165+
}
166+
},
167+
"additionalProperties": false
168+
},
169+
"revisions": {
170+
"$ref": "./shared.json#/definitions/GitRevisions"
171+
}
172+
},
173+
"required": [
174+
"type"
175+
],
176+
"additionalProperties": false
177+
}
178+
```
179+
180+
</Accordion>
140 KB
Loading

0 commit comments

Comments
 (0)