Skip to content

Commit 6820d19

Browse files
author
Andrew Orsich
authored
Merge pull request #4 from paralect/add-bitbucket-cloud-integration
Add bitbucket cloud integration
2 parents d6a2e6b + dc53849 commit 6820d19

3 files changed

Lines changed: 23 additions & 5 deletions

File tree

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
[![Follow](https://img.shields.io/twitter/follow/paralect.svg?style=social&label=Follow)](https://twitter.com/paralect)
1414
[![Tweet](https://img.shields.io/twitter/url/https/github.com/paralect/ansible-drone.svg?style=social)](https://twitter.com/intent/tweet?text=I%27m%20using%20Stack%20components%20to%20build%20my%20next%20product%20🚀.%20Check%20it%20out:%20https://github.com/paralect/ansible-drone)
1515

16-
An ansible role for the [drone](https://github.com/drone/drone) CI deployment with Github integration and PostgreSQL database.
16+
An ansible role for the [drone](https://github.com/drone/drone) CI deployment with Github/Bitbucket Cloud integration and PostgreSQL database.
1717

1818
## Role Variables
1919

@@ -26,8 +26,11 @@ Available variables:
2626
|**`drone_agents`**|`[{name: "Nancy"}]`|Name of the docker agent container, you can add more than one agent|
2727
|**`drone_host`**|`""`|The url, where drone instance will be publicly available. Typically you would have nginx in front of Drone CI|
2828
|**`drone_secret`**|`hTirsXmrY4YsyK79ELgB`|Drone secret key, used for private communication between agent and web UI [more info](http://docs.drone.io/install-for-github)|
29+
|**`drone_integration`**|`github`|Integration type used by Drone CI. Available types: {`github`,`bitbucket_cloud`}|
2930
|**`drone_github_client`**|`""`|Github oauth application client identifier, [more info](http://docs.drone.io/install-for-github)|
3031
|**`drone_github_secret`**|`""`|Github oauth application client secret, [more info]( http://docs.drone.io/install-for-github)|
32+
|**`drone_bitbucket_key`**|`""`|Bitbucket Cloud oauth application client key, [more info](http://docs.drone.io/install-for-bitbucket-cloud/)|
33+
|**`drone_bitbucket_secret`**|`""`|Bitbucket Cloud oauth application client secret, [more info](http://docs.drone.io/install-for-bitbucket-cloud/)|
3134
|**`drone_postgress_password`**|`droneRocks23@p`|A password to postgress db used by drone|
3235
|**`drone_postgress_user`**|`drone`|A username to postgress db used by drone, [read more](http://docs.drone.io/database-settings)|
3336
|**`drone_postgress_db`**|`drone`|A name of to postgress db used by drone, [read more](http://docs.drone.io/database-settings)|
@@ -71,9 +74,12 @@ Example of the playbook file:
7174
# more info: http://docs.drone.io/install-for-github/
7275
drone_secret: hTirsXmrY4YsyK79ELgB
7376

74-
# Github oauth application client identifier and secret, more info http://docs.drone.io/install-for-github/
75-
drone_github_client:
76-
drone_github_secret:
77+
# Drone integration type
78+
drone_integration: bitbucket_cloud
79+
80+
# Bitbucket Cloud oauth application client key and secret, more info http://docs.drone.io/install-for-bitbucket-cloud/
81+
drone_bitbucket_key:
82+
drone_bitbucket_secret:
7783

7884
# A password to postgress db used by drone
7985
drone_postgress_password: droneRocks23@p

defaults/main.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,20 @@ drone_host:
1515
# more info: http://docs.drone.io/install-for-github/
1616
drone_secret: hTirsXmrY4YsyK79ELgB
1717

18+
# Integration type used by Drone CI
19+
# Available types: {github,bitbucket_cloud}
20+
drone_integration: github
21+
1822
# Github oauth application client identifier, more info http://docs.drone.io/install-for-github/
1923
drone_github_client:
2024
# Github oauth application client secret, more info http://docs.drone.io/install-for-github/
2125
drone_github_secret:
2226

27+
# Bitbucket Cloud oauth application client key, more info http://docs.drone.io/install-for-bitbucket-cloud/
28+
drone_bitbucket_key:
29+
# Bitbucket Cloud oauth application client secret, more info http://docs.drone.io/install-for-bitbucket-cloud/
30+
drone_bitbucket_secret:
31+
2332
# A password to postgress db used by drone
2433
drone_postgress_password: droneRocks23@p
2534
# A username to postgress db used by drone, read more: http://docs.drone.io/database-settings/

tasks/drone.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,14 @@
2121
DRONE_OPEN: "false"
2222
DRONE_ADMIN: "{{drone_admins}}"
2323
DRONE_ADMIN_ALL: "false"
24-
DRONE_GITHUB: "true"
24+
DRONE_GITHUB: "{{drone_integration == 'github'}}"
2525
DRONE_GITHUB_CLIENT: "{{drone_github_client}}"
2626
DRONE_GITHUB_SECRET: "{{drone_github_secret}}"
2727
DRONE_GITHUB_SKIP_VERIFY: "true"
2828
DRONE_GITHUB_CONTEXT: "continuous-integration/drone"
29+
DRONE_BITBUCKET: "{{drone_integration == 'bitbucket_cloud'}}"
30+
DRONE_BITBUCKET_CLIENT: "{{drone_bitbucket_key}}"
31+
DRONE_BITBUCKET_SECRET: "{{drone_bitbucket_secret}}"
2932
tags:
3033
- drone
3134
- server

0 commit comments

Comments
 (0)