|
1 |
| -bitbucket-plugin |
2 |
| -================ |
| 1 | +Bitbucket Plugin for Jenkins |
| 2 | +============================ |
3 | 3 |
|
4 |
| -[](https://jenkins.ci.cloudbees.com/job/plugins/job/bitbucket-plugin/) |
| 4 | +[](https://ci.jenkins.io/job/Plugins/job/bitbucket-plugin/job/master/) |
| 5 | +[](https://plugins.jenkins.io/bitbucket/) |
| 6 | +[](https://github.com/jenkinsci/bitbucket-plugin/releases/latest/) |
| 7 | +[](https://plugins.jenkins.io/bitbucket/) |
5 | 8 |
|
6 |
| -See details on [wiki](https://wiki.jenkins-ci.org/display/JENKINS/BitBucket+Plugin) |
| 9 | +## About |
7 | 10 |
|
8 |
| -# Job DSL |
9 |
| -The plugin supports the following dsl extension to enable bitbucket pushes to trigger a build: |
| 11 | +Bitbucket plugin is designed to offer integration between Bitbucket and Jenkins. |
10 | 12 |
|
11 |
| -``` |
| 13 | +It exposes a single URI endpoint that you can add as a WebHook within each Bitbucket project you wish to integrate with. This single endpoint receives a full data payload from Bitbucket upon push (see their documentation), triggering compatible jobs to build based on changed repository/branch. |
| 14 | + |
| 15 | +Since 1.1.5 Bitbucket automatically injects the payload received by Bitbucket into the build. You can catch the payload to process it accordingly through the environmental variable $BITBUCKET\_PAYLOAD. |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | +## Bitbucket Cloud usage |
| 20 | + |
| 21 | +Configure your Bitbucket repository with a [Webhook](https://confluence.atlassian.com/bitbucket/manage-webhooks-735643732.html), using URL JENKINS\_URL/bitbucket-hook/ (no need for credentials but do remember the trailing slash). |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | +The older-style HTTP POSTs from Bitbucket are also supported but deprecated. |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | +On each push, the plugin: |
| 31 | + |
| 32 | +1. Scans Jenkins for all jobs with "Build when a change is pushed to Bitbucket" option enabled |
| 33 | +2. For each job matched: |
| 34 | + 1. If the job's SCM (git) URL "loosely matches" that of the git repository listed inside the Bitbucket-provided payload, AND |
| 35 | + 2. If the job's SCM (git) detects that the remote repository has changes, THEN |
| 36 | + 3. A full build of the job will be queued |
| 37 | + |
| 38 | +The "loose matching" is based on the host name and paths of the projects matching. |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | +## Bitbucket server usage |
| 43 | + |
| 44 | +Since the version 1.1.7 of the Bitbucket plugin works against Bitbucket server. For this plugin to work against Bitbucket server you must: |
| 45 | + |
| 46 | +1. Install [Post Webhooks for Bitbucket](https://marketplace.atlassian.com/plugins/nl.topicus.bitbucket.bitbucket-webhooks/server/overview) at Bitbucket side \[the plugin is free\] |
| 47 | +2. At repository level, delete the webhook in case it exists |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | +3. Create a Post-WebHook, which is different from WebHook and enable on push. |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | +After this, you are all set-up |
| 58 | + |
| 59 | +## Job DSL |
| 60 | + |
| 61 | +The current supported dsl is as follows: |
| 62 | + |
| 63 | +``` syntaxhighlighter-pre |
12 | 64 | freeStyleJob('test-job') {
|
13 | 65 | triggers{
|
14 | 66 | bitbucketPush()
|
15 | 67 | }
|
16 | 68 | }
|
17 | 69 | ```
|
| 70 | + |
| 71 | +**Changelog** |
| 72 | + |
| 73 | +#### 1.1.11 (27. August 2019) |
| 74 | + |
| 75 | +- Added possibility to process trigger from bitbucket server default webhooks [PR-63](https://github.com/jenkinsci/bitbucket-plugin/pull/63) |
| 76 | + |
| 77 | +#### 1.1.10 (4. July 2019) |
| 78 | + |
| 79 | +- Update job-dsl dependency to 1.66. |
| 80 | + See [PR-58](https://github.com/jenkinsci/bitbucket-plugin/pull/58) |
| 81 | + |
| 82 | +#### 1.1.9 (1. Jun 2019) |
| 83 | + |
| 84 | +- Address [Bitbucket API change](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/?_ga=2.164415676.2088283489.1559219877-1322535506.1557927444): |
| 85 | + [JENKINS-57787](https://issues.jenkins-ci.org/browse/JENKINS-57787) |
| 86 | + - Getting issue details... STATUS |
| 87 | + |
| 88 | +#### 1.1.7 (6. Dec 2017) |
| 89 | + |
| 90 | +- Add Jenkins ci integration |
| 91 | +- [JENKINS-28877](https://issues.jenkins-ci.org/browse/JENKINS-28877) : |
| 92 | + Add integration for Bitbucket server |
| 93 | + |
| 94 | +#### 1.1.6 (2. Nov 2017) |
| 95 | + |
| 96 | +- fix |
| 97 | + [JENKINS-44309](https://issues.jenkins-ci.org/browse/JENKINS-44309) |
| 98 | + Add support for Symbol |
| 99 | + |
| 100 | +#### 1.1.5 (26. Jan 2016) |
| 101 | + |
| 102 | +- fix |
| 103 | + [JENKINS-32372](https://issues.jenkins-ci.org/browse/JENKINS-32372) |
| 104 | + Inject the Payload into the build through $BITBUCKET\_PAYLOAD |
| 105 | + |
| 106 | +#### 1.1.4 (28. Dec 2015) |
| 107 | + |
| 108 | +- Add |
| 109 | + [JENKINS-31185](https://issues.jenkins-ci.org/browse/JENKINS-31185) hg |
| 110 | + support |
| 111 | +- Add [Job DSL extension](https://github.com/jenkinsci/bitbucket-plugin/pull/24) |
| 112 | +- fix |
| 113 | + [JENKINS-26234](https://issues.jenkins-ci.org/browse/JENKINS-26234) |
| 114 | + CSRF support |
| 115 | + |
| 116 | +#### 1.1.3 (16. Oct 2015) |
| 117 | + |
| 118 | +- fix |
| 119 | + [JENKINS-29096](https://issues.jenkins-ci.org/browse/JENKINS-29096) |
| 120 | + Advice users when they don't use the right hook url - last \`/\` |
| 121 | +- fix |
| 122 | + [JENKINS-30985](https://issues.jenkins-ci.org/browse/JENKINS-30985) |
| 123 | + Jobs with the same git repository defined several times in the scm should be triggered only once |
| 124 | + |
| 125 | +#### 1.1.2 (4. August 2015) |
| 126 | + |
| 127 | +- fix |
| 128 | + [JENKINS-28882](https://issues.jenkins-ci.org/browse/JENKINS-28882) |
| 129 | + Workflow support for BitBucket trigger |
| 130 | + |
| 131 | +#### 1.1.1 (9. July 2015) |
| 132 | + |
| 133 | +- Allow Webhooks 2.0 |
| 134 | + |
| 135 | +#### 1.1.0 (10. March 2015) |
| 136 | + |
| 137 | +- fix |
| 138 | + [JENKINS-24999](https://issues.jenkins-ci.org/browse/JENKINS-24999) |
| 139 | + Build triggered by SCM change without activating trigger in the job configuration |
| 140 | +- fix |
| 141 | + [JENKINS-26413](https://issues.jenkins-ci.org/browse/JENKINS-26413) |
| 142 | + BitBucket trigger doesn't need to Initialize LogFile |
| 143 | +- fix |
| 144 | + [JENKINS-26489](https://issues.jenkins-ci.org/browse/JENKINS-26489) |
| 145 | + Action report for the bitbucket polling log on web UI |
| 146 | +- fix |
| 147 | + [JENKINS-26805](https://issues.jenkins-ci.org/browse/JENKINS-26805) |
| 148 | + Job is not triggered after merging a branch |
| 149 | + |
| 150 | +#### 1.0 |
| 151 | + |
| 152 | +- initial implementation |
0 commit comments