|
1 | 1 | # Pull Request Notifier for Bitbucket Server [](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. |
3 | 2 |
|
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! |
8 | 4 |
|
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. |
10 | 6 |
|
11 | 7 | [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.
|
12 | 8 |
|
13 |
| - |
14 | 9 | [Here](http://bjurr.com/continuous-integration-with-bitbucket-server-and-jenkins/) is a blog post that includes the plugin.
|
15 | 10 |
|
16 |
| -Available in [Atlassian Marketplace](https://marketplace.atlassian.com/plugins/se.bjurr.prnfs.pull-request-notifier-for-stash). |
17 |
| - |
18 | 11 | ## Features
|
19 | 12 | The Pull Request Notifier for Bitbucket Server can:
|
20 | 13 |
|
@@ -49,10 +42,10 @@ The filter text as well as the URL support variables. These are:
|
49 | 42 |
|
50 | 43 | | Variable | Description |
|
51 | 44 | | :------- | :---------- |
|
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...` | |
53 | 46 | | `${PULL_REQUEST_ID}` | Example: `1` |
|
54 | 47 | | `${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 | |
56 | 49 | | `${PULL_REQUEST_VERSION}` | Example: `1` |
|
57 | 50 | | `${PULL_REQUEST_COMMENT_TEXT}` | Example: `A comment` |
|
58 | 51 | | `${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
|
119 | 112 |
|
120 | 113 | 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.
|
121 | 114 |
|
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 |
123 | 126 |
|
124 | 127 | 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.
|
125 | 128 |
|
@@ -182,7 +185,7 @@ When submitted with the default values, it will look like this:
|
182 | 185 | }
|
183 | 186 | ```
|
184 | 187 |
|
185 |
| -### REST |
| 188 | +### REST API |
186 | 189 | 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).
|
187 | 190 |
|
188 | 191 | * `/bitbucket/rest/prnfb-admin/1.0/settings`
|
@@ -228,54 +231,3 @@ It will respond with something like this.
|
228 | 231 | ```
|
229 | 232 |
|
230 | 233 | 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