-
-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #516 from azz/bitbucket-server
WIP: Add Bitbucket Server Support
- Loading branch information
Showing
62 changed files
with
4,286 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
title: Danger + BitBucket Server | ||
subtitle: Dangerous bits | ||
layout: guide_js | ||
order: 4 | ||
blurb: Some examples of Danger with BitBucket Server | ||
--- | ||
|
||
To use Danger JS with BitBucket Server: you'll need to create a new account for Danger to use, | ||
then set the following environment variables on your CI: | ||
|
||
* `DANGER_BITBUCKETSERVER_HOST` = The root URL for your server, e.g. `https://bitbucket.mycompany.com`. | ||
* `DANGER_BITBUCKETSERVER_USERNAME` = The username for the account used to comment. | ||
* `DANGER_BITBUCKETSERVER_PASSWORD` = The password for the account used to comment. | ||
|
||
Then you will have a fully fleshed out `danger.bitbucket_server` object in your Dangerfile to work with, | ||
for example: | ||
|
||
```ts | ||
import { danger, warn } from "danger" | ||
|
||
if (danger.bitbucket_server.pr.title.includes("WIP")) { | ||
warn("PR is considered WIP") | ||
} | ||
``` | ||
|
||
The DSL is fully fleshed out, you can see all the details inside the [Danger JS Reference][ref], | ||
but the summary is: | ||
|
||
```ts | ||
danger.bitbucket_server. | ||
/** The pull request and repository metadata */ | ||
metadata: RepoMetaData | ||
/** The related JIRA issues */ | ||
issues: JIRAIssue[] | ||
/** The PR metadata */ | ||
pr: BitBucketServerPRDSL | ||
/** The commits associated with the pull request */ | ||
commits: BitBucketServerCommit[] | ||
/** The comments on the pull request */ | ||
comments: BitBucketServerPRActivity[] | ||
/** The activities such as OPENING, CLOSING, MERGING or UPDATING a pull request */ | ||
activities: BitBucketServerPRActivity[] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
class DummyCI { | ||
get name() { return "Dummy Testing CI" } | ||
get name() { | ||
return "Dummy Testing CI" | ||
} | ||
|
||
get isCI() { return false } | ||
get isPR() { return true } | ||
get isCI() { | ||
return false | ||
} | ||
get isPR() { | ||
return true | ||
} | ||
|
||
get pullRequestID() { return this.env.pr } | ||
get repoSlug() { return this.env.repo } | ||
get supportedPlatforms() { return ["github"] } | ||
get pullRequestID() { | ||
return this.env.pr | ||
} | ||
get repoSlug() { | ||
return this.env.repo | ||
} | ||
} | ||
|
||
module.exports = DummyCI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.