You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/content/docs/integrations/bitbucket.md
+21-155
Original file line number
Diff line number
Diff line change
@@ -17,168 +17,34 @@ This integration enables some features:
17
17
- Send [build notifications](https://developer.atlassian.com/server/bitbucket/how-tos/updating-build-status-for-commits/) on your Pull-Requests and Commits on Bitbucket. [More informations]({{<relref "/docs/concepts/workflow/notifications.md#vcs-notifications" >}})
18
18
-[Send comments on your Pull-Requests when a workflow is failed]({{<relref "/docs/concepts/workflow/notifications.md#vcs-notifications" >}})
19
19
20
-
##How to configure Bitbucket Server integration
20
+
### Create the Personal Access Token on Bitbucket Datacenter
21
21
22
-
You need to perform the following steps:
22
+
Generate a new token on https://your-bitbucket-datacenter/plugins/servlet/access-tokens/manage with the following scopes:
23
+
-`PROJECT READ`
24
+
-`REPOSITORY READ`
23
25
24
-
- Bitbucket admin privileges
25
-
- A RSA Key Pair
26
-
27
-
### Generate RSA Key Pair
28
-
29
-
Create the private RSA certificate:
30
-
31
-
```
32
-
$ openssl genrsa -out key.pem 1024
33
-
```
34
-
35
-
The content of key.pem have to be used as `privateKey` below in CDS Configuration file.
36
-
37
-
Generate the public RSA certificate:
38
-
39
-
```
40
-
$ openssl rsa -in key.pem -pubout
41
-
```
42
-
43
-
This will display the public key, you will have to copy-paste it inside `Public Key` field on Bitbucket.
44
-
45
-
46
-
### Create a CDS application in Bitbucket
47
-
In Bitbucket go to *Administration Settings* / *Application Links*. Create a new Application with:
48
-
49
-
- Name: **CDS**
50
-
- Type: **Generic Application**
51
-
- Application URL: *Your CDS API URL*
52
-
- Display URL: *Your CDS API URL*
53
-
54
-
On this application, you just have to set up *OAuth Incoming Authentication*:
55
-
56
-
- Consumer Key: **CDS** (you can change it in your configuration file)
57
-
- Consumer Name: **CDS**
58
-
- Public Key: *Your CDS RSA public key*
59
-
- Consumer Callback URL: None
60
-
- Allow 2-Legged OAuth: false
61
-
- Execute as: None
62
-
- Allow user impersonation through 2-Legged OAuth: false
63
-
64
-
### Complete CDS Configuration File
65
-
66
-
Set value to `privateKey`. You can modify `consumerKey` if you want.
67
-
68
-
```yaml
69
-
[vcs.servers]
70
-
71
-
[vcs.servers.Bitbucket]
72
-
73
-
# URL of this VCS Server
74
-
url = "https://mybitbucket.com"
75
-
76
-
[vcs.servers.Bitbucket.bitbucket]
77
-
78
-
#######
79
-
# CDS <-> Bitbucket. Documentation on https://ovh.github.io/cds/hosting/repositories-manager/bitbucket/
# If you want to have a reverse proxy URL for your repository webhook, for example if you put https://myproxy.com it will generate a webhook URL like this https://myproxy.com/UUID_OF_YOUR_WEBHOOK
92
-
# proxyWebhook = ""
93
-
94
-
# optional, Bitbucket Token associated to username, used to add comment on Pull Request
95
-
token = ""
96
-
97
-
# optional. Bitbucket username, used to add comment on Pull Request on failed build.
98
-
username = ""
99
-
100
-
[vcs.servers.Bitbucket.bitbucket.Status]
101
-
102
-
# Set to true if you don't want CDS to push statuses on the VCS server
103
-
# disable = false
104
-
```
105
-
106
-
You can configure many instances of Bitbucket:
26
+
### Import configuration
107
27
28
+
Create a yml file:
108
29
109
30
```yaml
110
-
111
-
[vcs.servers]
112
-
113
-
[vcs.servers.mybitbucket_instance1]
114
-
115
-
# URL of this VCS Server
116
-
url = "https://mybitbucket-instance1.localhost"
117
-
118
-
[vcs.servers.mybitbucket_instance1.bitbucket]
119
-
consumerKey = "CDS_Instance1"
120
-
121
-
# Does polling is supported by VCS Server
122
-
disablePolling = true
123
-
124
-
# Does webhooks are supported by VCS Server
125
-
disableWebHooks = false
126
-
127
-
# Does webhooks creation are supported by VCS Server
# If you want to have a reverse proxy URL for your repository webhook, for example if you put https://myproxy.com it will generate a webhook URL like this https://myproxy.com/UUID_OF_YOUR_WEBHOOK
# If you want to have a reverse proxy URL for your repository webhook, for example if you put https://myproxy.com it will generate a webhook URL like this https://myproxy.com/UUID_OF_YOUR_WEBHOOK
Copy file name to clipboardexpand all lines: docs/content/docs/integrations/bitbucketcloud.md
+38-120
Original file line number
Diff line number
Diff line change
@@ -18,128 +18,46 @@ This integration enables some features:
18
18
19
19
## How to configure Bitbucket Cloud integration
20
20
21
-
+ Follow documentation on https://support.atlassian.com/bitbucket-cloud/docs/use-oauth-on-bitbucket-cloud/, section **Create a consumer**
22
-
+ Bitbucket requests some informations:
23
-
++ **name** you can simply write CDS
24
-
++ **description** is optional
25
-
++ **callback url** must be the URL of your CDS -> `{CDS_UI_URL}/cdsapi/repositories_manager/oauth2/callback` (if you are in development mode you have to omit /cdsapi and replace {CDS_UI_URL} with your API URL)
+ Click on Save and toggle the consumer name to see the generated `Key` and `Secret`. It correspond to `clientId` and `clientSecret` in the CDS config.toml file.
29
-
30
-
### Complete CDS Configuration File
31
-
32
-
#### VCS µService Configuration
33
-
34
-
If you don't already have any of vcs integrations on your CDS please follow these steps. The file configuration for the VCS µService can be retreived with:
35
-
36
-
```bash
37
-
$ engine config new vcs > vcs-config.toml
38
-
39
-
# or with all other configuration parts:
40
-
$ engine config new > config.toml
41
-
```
42
-
43
-
Edit the toml file:
44
-
45
-
- section `[vcs.api]`
46
-
- this section will be used to communicate with CDS API. Check the url and the consumer token generated by CDS.
47
-
- Token can be generated with cdsctl:
48
-
49
-
```bash
50
-
$ cdsctl consumer new me \
51
-
--scopes=Service \
52
-
--name="cds-vcs" \
53
-
--description="Consumer token for vcs service" \
54
-
--groups="" \
55
-
--no-interactive
56
-
57
-
Builtin consumer successfully created, use the following token to sign in:
# Set to true if you don't want CDS to push statuses on the VCS server
108
-
disable = false
109
-
110
-
# Set to true if you don't want CDS to push CDS URL in statuses on the VCS server
111
-
showDetail = false
112
-
```
113
-
114
-
#### hooks µService Configuration
115
-
116
-
If you have not already a hooks µService configured. Then, as the `vcs` µService, you have to configure the `hooks` µService
117
-
118
-
```bash
119
-
$ engine config new hooks > hooks-config.toml
21
+
- Follow the section **Create a consumer** on documentation https://support.atlassian.com/bitbucket-cloud/docs/use-oauth-on-bitbucket-cloud/
22
+
- Bitbucket requests some informations:
23
+
-**name** you can simply write CDS
24
+
-**description** is optional
25
+
-**callback url** must be the URL of your CDS -> `{CDS_UI_URL}/cdsapi/repositories_manager/oauth2/callback` (if you are in development mode you have to omit /cdsapi and replace {CDS_UI_URL} with your API URL)
- Click on Save and toggle the consumer name to see the generated `Key` and `Secret`. It correspond to `clientId` and `clientSecret` in the CDS config.toml file.
29
+
30
+
### Create the Personal Access Token on Bitbucket Datacenter
31
+
32
+
On https://bitbucket.org/account/settings/app-passwords/ create a new app password with the following scopes:
33
+
- Account `Email` and `Read`
34
+
- Workspace membership `Read`
35
+
- Projects `Read`
36
+
- Repositories `Read` and `Write`
37
+
- Pull requests `Read` and `Write`
38
+
- Webhooks `Read and write`
39
+
40
+
### Import configuration
41
+
42
+
Create a yml file:
43
+
44
+
```yaml
45
+
version: v1.0
46
+
name: bitbucket-cloud
47
+
type: bitbucketcloud
48
+
description: "My Bitbucket Cloud"
49
+
auth:
50
+
user: my-user-on-bitbucket-cloud
51
+
token: the-long-token-here
52
+
options:
53
+
disableStatus: false # Set to true if you don't want CDS to push statuses on the VCS server - optional
54
+
disableStatusDetails: false # Set to true if you don't want CDS to push CDS URL in statuses on the VCS server - optional
55
+
disablePolling: false # Does polling is supported by VCS Server - optional
56
+
disableWebHooks: false # Does webhooks are supported by VCS Server - optional
120
57
```
121
58
122
-
In the `[hooks]` section
123
-
124
-
- check the URL, this will be used by CDS API to call CDS Hooks
125
-
- configure `urlPublic` if you want to use [simple Webhook]({{<relref "/docs/concepts/workflow/hooks/webhook.md">}})
126
-
- add a name, as `cds-hooks`
127
-
128
-
In the `[hooks.api]` section
129
-
130
-
- put the same token as the `[vcs.api]` section
131
-
132
-
133
-
### Start the vcs and hooks µService
134
-
135
-
*As a CDS Administrator*
136
-
137
-
```bash
138
-
$ engine start vcs --config vcs-config.toml
139
-
$ engine start hooks --config hooks-config.toml
140
-
141
-
# you can also start CDS api and vcs in the same process:
0 commit comments