Skip to content
This repository was archived by the owner on Jun 9, 2021. It is now read-only.

Commit e6717f4

Browse files
committed
doc
1 parent 0e316eb commit e6717f4

File tree

3 files changed

+58
-65
lines changed

3 files changed

+58
-65
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Changelog of Pull Request Notifier for Bitbucket.
66
### GitHub [#192](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/issues/192) Include status for participants
77
Variables to display names of approved, unapproved and needs work
88

9-
[5417db3500e869c](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/5417db3500e869c) Tomas Bjerre *2017-02-02 16:48:45*
9+
[dba06db7fd2b4d9](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/dba06db7fd2b4d9) Tomas Bjerre *2017-02-02 17:12:47*
1010

1111
### No issue
1212
doc

CONTRIBUTING.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Developer instructions
2+
There are some scripts to help working with the plugin.
3+
4+
* `./setup-atlassian-sdk.sh` Setup Atlassian SDK.
5+
* `./docker-build.sh` Build Docker container.
6+
* `./docker-run.sh` Run the Docker container.
7+
* `./integration-test-local.sh` Run integration tests against localhost.
8+
* `./integration-test.sh` Start Docker container and then runs integration tests against it.
9+
10+
The .travis.yml is setting up Atlas SDK and building the plugin. It may help you setup your environment.
11+
12+
Prerequisites:
13+
14+
* Atlas SDK [(installation instructions)](https://developer.atlassian.com/docs/getting-started/set-up-the-atlassian-plugin-sdk-and-build-a-project).
15+
* JDK 1.8 or newer
16+
17+
Generate Eclipse project:
18+
```
19+
atlas-compile eclipse:eclipse
20+
```
21+
22+
Package the plugin:
23+
```
24+
atlas-package
25+
```
26+
27+
Run Bitbucket, with the plugin, on localhost:
28+
```
29+
export MAVEN_OPTS=-Dplugin.resource.directories=`pwd`/src/main/resources
30+
atlas-run
31+
```
32+
33+
You can also remote debug on port 5005 with:
34+
```
35+
atlas-debug
36+
```
37+
38+
Make a release [(detailed instructions)](https://developer.atlassian.com/docs/common-coding-tasks/development-cycle/packaging-and-releasing-your-plugin):
39+
```
40+
mvn -B release:prepare -DperformRelease=true release:perform
41+
```

README.md

Lines changed: 16 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
# Pull Request Notifier for Bitbucket Server [![Build Status](https://travis-ci.org/tomasbjerre/pull-request-notifier-for-bitbucket.svg?branch=master)](https://travis-ci.org/tomasbjerre/pull-request-notifier-for-bitbucket)
2-
The original use case was to trigger Jenkins jobs to build pull requests that are created in Bitbucket Server. The plugin can be configured to trigger different Jenkins jobs for different repositories. It can supply custom parameters to the jenkins job using the variables. It can authenticate with HTTP Basic.
32

4-
It can, for example, trigger a build in Jenkins. Parameterized Jenkins jobs can be triggered remotely via:
5-
```
6-
http://server/job/theJob/buildWithParameters?token=TOKEN&PARAMETER=Value
7-
```
3+
This is a Bitbucket Server plugin that can invoke custom URL:s, supporting variables, when configured events occur on pull requests in Bitbucket Server. It can notify Jenkins, Bamboo, TeamCity, HipChat and many more!
84

9-
The plugin can trigger any system, not only Jenkins. The plugin can notify any system that can be notified with a URL.
5+
The original use case was to trigger Jenkins jobs to build and verify pull requests but it can trigger any system. The plugin can notify any system that can be notified with a URL.
106

117
[Here](https://raw.githubusercontent.com/tomasbjerre/pull-request-notifier-for-bitbucket/master/sandbox/all.png) is a screenshot of the admin GUI on global level. And [here](https://raw.githubusercontent.com/tomasbjerre/pull-request-notifier-for-bitbucket/master/sandbox/repo.png) is a screenshot of the admin GUI on repository level.
128

13-
149
[Here](http://bjurr.com/continuous-integration-with-bitbucket-server-and-jenkins/) is a blog post that includes the plugin.
1510

16-
Available in [Atlassian Marketplace](https://marketplace.atlassian.com/plugins/se.bjurr.prnfs.pull-request-notifier-for-stash).
17-
1811
## Features
1912
The Pull Request Notifier for Bitbucket Server can:
2013

@@ -49,10 +42,10 @@ The filter text as well as the URL support variables. These are:
4942

5043
| Variable | Description |
5144
| :------- | :---------- |
52-
| `${EVERYTHING_URL}` | This variable is resolved to all available variables. The name of each parameter is the name of that variable. <br /> Example: `PULL_REQUEST_ID=1&PULL_REQUEST_TITLE=some%20thing...` |
45+
| `${EVERYTHING_URL}` | This variable is resolved to all available variables. The name of each parameter is the name of that variable. Example: `PULL_REQUEST_ID=1&PULL_REQUEST_TITLE=some%20thing...` |
5346
| `${PULL_REQUEST_ID}` | Example: `1` |
5447
| `${PULL_REQUEST_TITLE}` | Example: `Anything` |
55-
| `${PULL_REQUEST_DESCRIPTION}` | The `${EVERYTHING_URL}` does not include this because it makes the URL very big. | Example: Anything |
48+
| `${PULL_REQUEST_DESCRIPTION}` | The `${EVERYTHING_URL}` does not include this because it makes the URL very big. Example: Anything |
5649
| `${PULL_REQUEST_VERSION}` | Example: `1` |
5750
| `${PULL_REQUEST_COMMENT_TEXT}` | Example: `A comment` |
5851
| `${PULL_REQUEST_COMMENT_ACTION}` | Example: `ADDED`, `DELETED`, `EDITED`, `REPLIED` |
@@ -119,7 +112,17 @@ The ${PULL_REQUEST_USER...} contains information about the user who issued the e
119112

120113
You may want to use [Violation Comments to Bitbucket Server plugin](https://wiki.jenkins-ci.org/display/JENKINS/Violation+Comments+to+Bitbucket+Server+Plugin) and/or [StashNotifier plugin](https://wiki.jenkins-ci.org/display/JENKINS/StashNotifier+Plugin) to report results back to Bitbucket.
121114

122-
#### Button Forms
115+
### Integration guides
116+
117+
Generally, when fiddling with this plugin, you may want to use something like [RequestBin](https://requestb.in/). Let the notification URL point to it and you can inspect what the invoked URL looks like.
118+
119+
Here are some guides on how to use the plugin with different systems. Feel free to add guides through pull requests to this repo!
120+
121+
* [Jenkins](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/blob/master/README_jenkins.md)
122+
* [HipChat](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/blob/master/README_hipchat.md)
123+
* [Slack](https://github.com/Igogrek/bitbucket-slack-notifier)
124+
125+
### Button Forms
123126

124127
For each button you can specify a form that will show up when the button is pressed. That form data will then be submitted and will be available in the ${BUTTON_FORM_DATA} variable. Additionally, the form itself can reference other variables (with the exception of the ${BUTTON_...} ones) and will have those resolved prior to rendering.
125128

@@ -182,7 +185,7 @@ When submitted with the default values, it will look like this:
182185
}
183186
```
184187

185-
### REST
188+
### REST API
186189
Some rest resources are available. You can figure out the JSON structure by looking at the [DTO:s](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/tree/master/src/main/java/se/bjurr/prnfb/presentation/dto).
187190

188191
* `/bitbucket/rest/prnfb-admin/1.0/settings`
@@ -228,54 +231,3 @@ It will respond with something like this.
228231
```
229232

230233
You may use Chrome and Developer Tools (press F12) to view rest calls while editing in GUI to find more examples.
231-
232-
## Integration guides
233-
234-
Generally, when fiddling with this plugin, you may want to use something like [RequestBin](https://requestb.in/). Let the notification URL point to it and you can inspect what the invoked URL looks like.
235-
236-
Here are some guides on how to use the plugin with different systems. Feel free to add guides through pull requests to this repo!
237-
238-
* [Jenkins](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/blob/master/README_jenkins.md)
239-
* [HipChat](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/blob/master/README_hipchat.md)
240-
241-
## Developer instructions
242-
There are some scripts to help working with the plugin.
243-
244-
* `./setup-atlassian-sdk.sh` Setup Atlassian SDK.
245-
* `./docker-build.sh` Build Docker container.
246-
* `./docker-run.sh` Run the Docker container.
247-
* `./integration-test-local.sh` Run integration tests against localhost.
248-
* `./integration-test.sh` Start Docker container and then runs integration tests against it.
249-
250-
The .travis.yml is setting up Atlas SDK and building the plugin. It may help you setup your environment.
251-
252-
Prerequisites:
253-
254-
* Atlas SDK [(installation instructions)](https://developer.atlassian.com/docs/getting-started/set-up-the-atlassian-plugin-sdk-and-build-a-project).
255-
* JDK 1.8 or newer
256-
257-
Generate Eclipse project:
258-
```
259-
atlas-compile eclipse:eclipse
260-
```
261-
262-
Package the plugin:
263-
```
264-
atlas-package
265-
```
266-
267-
Run Bitbucket, with the plugin, on localhost:
268-
```
269-
export MAVEN_OPTS=-Dplugin.resource.directories=`pwd`/src/main/resources
270-
atlas-run
271-
```
272-
273-
You can also remote debug on port 5005 with:
274-
```
275-
atlas-debug
276-
```
277-
278-
Make a release [(detailed instructions)](https://developer.atlassian.com/docs/common-coding-tasks/development-cycle/packaging-and-releasing-your-plugin):
279-
```
280-
mvn -B release:prepare -DperformRelease=true release:perform
281-
```

0 commit comments

Comments
 (0)