Skip to content

Commit

Permalink
Bitbucket Cloud: Get rid of DANGER_BITBUCKETCLOUD_UUID on documents
Browse files Browse the repository at this point in the history
  • Loading branch information
HelloCore committed Dec 6, 2019
1 parent b639246 commit 61084fc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
11 changes: 3 additions & 8 deletions docs/guides/the_dangerfile.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,14 @@ export DANGER_BITBUCKETSERVER_HOST='xxxx' DANGER_BITBUCKETSERVER_USERNAME='yyyy'
# or for BitBucket by username and personal access token
export DANGER_BITBUCKETSERVER_HOST='xxxx' DANGER_BITBUCKETSERVER_USERNAME='yyyy' DANGER_BITBUCKETSERVER_TOKEN='zzzz'

# or for BitBucket Cloud by username (from Account Settings page), password (App-password with Read Pull requests Permission is enough), and UUID
# We need UUID for updating comment, you can get it from the link on your home page of bitbucket.org
# For example, https://bitbucket.org/%7Bzzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz%7D/
# Then replace "%7B" with "{" and "%7D" with "}"
# or for BitBucket Cloud by username (from Account Settings page), password (App-password with Read Pull requests, and Read Account Permissions)
export DANGER_BITBUCKETCLOUD_USERNAME='xxxx'
export DANGER_BITBUCKETCLOUD_PASSWORD='yyyy'
export DANGER_BITBUCKETCLOUD_UUID='{zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz}'

# or for BitBucket Cloud by OAuth key, and OAuth secret, UUID
# You can get OAuth key from Settings > OAuth > Add consumer, put `https://bitbucket.org/site/oauth2/authorize` for `Callback URL`, and enable Pull requests Permission.
# or for BitBucket Cloud by OAuth key, and OAuth secret
# You can get OAuth key from Settings > OAuth > Add consumer, put `https://bitbucket.org/site/oauth2/authorize` for `Callback URL`, and enable Read Pull requests, and Read Account Permissions.
export DANGER_BITBUCKETCLOUD_OAUTH_KEY='xxxx'
export DANGER_BITBUCKETCLOUD_OAUTH_SECRET='yyyy'
export DANGER_BITBUCKETCLOUD_UUID='{zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz}'
```

Then the danger CLI will use authenticated API calls, which don't get this by API limits.
Expand Down
13 changes: 3 additions & 10 deletions docs/usage/bitbucket_cloud.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ blurb: An overview of using Danger with BitBucket Cloud, and some examples
To use Danger JS with BitBucket Cloud: you'll need to create a new account for Danger to use, then set the following
environment variables on your CI:

We need UUID for updating comment, you can get it from the link on your home page of bitbucket.org. Then replace `%7B`
with `{` and `%7D` with `}`.

For example, the UUID of `https://bitbucket.org/%7Bzzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz%7D/` will be
`{zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz}`

- `DANGER_BITBUCKETCLOUD_UUID` = The uuid for the account used to comment.

You could use either username with password or OAuth key with OAuth secret.

For username and password, you need to set.
Expand All @@ -25,13 +17,14 @@ For username and password, you need to set.
https://bitbucket.org/account/
- `DANGER_BITBUCKETCLOUD_PASSWORD` = The password for the account used to comment, you could use
[App passwords](https://confluence.atlassian.com/bitbucket/app-passwords-828781300.html#Apppasswords-Aboutapppasswords)
with Read Pull Requests Permission.
with Read Pull Requests and Read Account Permissions.

For OAuth key and OAuth secret, you can get them from.

- Open [BitBucket Cloud Website](https://bitbucket.org)
- Navigate to Settings > OAuth > Add consumer
- Put `https://bitbucket.org/site/oauth2/authorize` for `Callback URL`, and enable Pull requests Permission.
- Put `https://bitbucket.org/site/oauth2/authorize` for `Callback URL`, and enable Read Pull requests, and Read Account
Permission.

- `DANGER_BITBUCKETCLOUD_OAUTH_KEY` = The consumer key for the account used to comment, as show as `Key` on the website.
- `DANGER_BITBUCKETCLOUD_OAUTH_SECRET` = The consumer secret for the account used to comment, as show as `Secret` on the
Expand Down
1 change: 0 additions & 1 deletion source/ci_source/providers/BitbucketPipelines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import { ensureEnvKeysExist, ensureEnvKeysAreInt } from "../ci_source_helpers"
*
* ### Token Setup
*
* Add `DANGER_BITBUCKETCLOUD_UUID` to your pipeline repository variable.
* You can either add `DANGER_BITBUCKETCLOUD_USERNAME`, `DANGER_BITBUCKETCLOUD_PASSWORD`
* or add `DANGER_BITBUCKETCLOUD_OAUTH_KEY`, `DANGER_BITBUCKETCLOUD_OAUTH_SECRET`
* -
Expand Down

0 comments on commit 61084fc

Please sign in to comment.