Alessio Caiazza is sharing code with you

Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.

Don't show this again

nolith / redmine-bitbucket

Allow your Redmine installation to be notified when changes have been pushed to a Bitbucket repository.

Clone this repository (size: 55.0 KB): HTTPS / SSH
hg clone https://bitbucket.org/nolith/redmine-bitbucket
hg clone ssh://hg@bitbucket.org/nolith/redmine-bitbucket

redmine-bitbucket / README.rdoc

commit
5f57c2aba884
parent
de60f57771f8
branch
default

Fixed README

1
5f57c2aba884
= Redmine Bitbucket Hook
2
a2c1efbea0cd
3
5f57c2aba884
This plugin allows you to update your local Mercurial repositories in Redmine when changes have been pushed to Bitbucket.
4
5f57c2aba884
5
5f57c2aba884
This plugin is a fork from Redmine Github Hook from Jakob Skjerning ( http://github.com/koppen/redmine_github_hook )
6
5b0e96544a07
7
5b0e96544a07
== Description
8
5b0e96544a07
9
5f57c2aba884
Redmine <http://redmine.org> has supported Mercurial repositories for a long time, allowing you to browse your code and view your changesets directly in Redmine. For this purpose, Redmine relies on local clones of the Mercurial repositories.
10
5b0e96544a07
11
5f57c2aba884
If your shared repository is on a remote machine - for example on Bitbucket - this unfortunately means a bit of legwork to keep the local, Redmine-accessible repository up-to-date. The common approach is to set up a cronjob that pulls in any changes with regular intervals and updates Redmine with them.
12
5b0e96544a07
13
5f57c2aba884
That approach works perfectly fine, but is a bit heavy-handed and cumbersome. The Redmine Bitbucket Hook plugin allows Bitbucket to notify your Redmine installation when changes have been pushed to a repository, triggering an update of your local repository and Redmine data only when it is actually necessary.
14
5b0e96544a07
15
5b0e96544a07
16
5b0e96544a07
== Installation
17
5b0e96544a07
18
5b0e96544a07
1. Installing the plugin
19
5b0e96544a07
   1. Install the json gem <http://json.rubyforge.org/> on the machine where Redmine is running.
20
5b0e96544a07
   2. Follow the plugin installation procedure at http://www.redmine.org/wiki/redmine/Plugins.
21
5b0e96544a07
   3. Restart your Redmine.
22
5f57c2aba884
   4. If you already have a local Mercurial repository set up and working from Redmine go to step 3, otherwise continue at step 2.
23
5b0e96544a07
24
5f57c2aba884
2. Adding a Mercurial repository to a project (note, this should work whether you want to use Redmine Bitbucket Hook or not). Either follow the instructions at http://www.redmine.org/wiki/redmine/HowTo_keep_in_sync_your_git_repository_for_redmine or the ones below:
25
5b0e96544a07
   1. Go to the directory on your Redmine machine where you want to keep your repository, for example /home/redmine/repositories/.
26
5f57c2aba884
   2. Get a clone of the repository into that location: hg clone http://bitbucket.org/nolith/redmine-bitbucket. This creates a repository directory at /home/redmine/repositories/redmine-bitbucket/.
27
5f57c2aba884
   3. Open Redmine in your browser and navigate to the Settings for the project you want to add a Mercurial repository to.
28
5f57c2aba884
   4. Under the Repository tab, choose Mercurial as your SCM and enter the full path to the repository directory from step 2; /home/redmine/repositories/redmine-bitbucket/ . Click "Create".
29
50f9e49fa80b
   5. Click the new "Repository" link in the main navigation to verify that your repository integration works - this might take a while as Redmine is fetching all commits.
30
5b0e96544a07
31
5f57c2aba884
3. Connecting Bitbucket to Redmine
32
5f57c2aba884
   1. Go to the repository Admin interface on Bitbucket and click the 'Service' link on 'Additional options/settings' menu.
33
5f57c2aba884
   2. Under "Services Administration" add a new "POST" service.
34
5f57c2aba884
   3. Compile the URL field with: "[redmine_installation_url]/bitbucket_hook" (for example "http://example.com/bitbucket_hook").
35
5b0e96544a07
36
5f57c2aba884
That's it. Bitbucket will now send a HTTP POST to the Redmine Bitbucket Hook plugin whenever changes are pushed to Bitbucket. The plugin then takes care of pulling the changes to the local repository and updating the Redmine database with them.
37
5b0e96544a07
38
5b0e96544a07
39
5b0e96544a07
== Assumptions
40
5b0e96544a07
41
5f57c2aba884
* Your project identifier in Redmine is the same as the project name on Bitbucket.
42
5b0e96544a07
* Redmine 0.8 running on a *nix-like system.
43
5f57c2aba884
* Mercurial available on the commandline and the repository has the bitbucket url as a default path.
44
5b0e96544a07
45
5b0e96544a07
46
5b0e96544a07
== License
47
5b0e96544a07
48
5f57c2aba884
Copyright (c) 2010 Alessio Caiazza
49
5b0e96544a07
Copyright (c) 2009 Jakob Skjerning
50
5b0e96544a07
51
5b0e96544a07
Permission is hereby granted, free of charge, to any person
52
5b0e96544a07
obtaining a copy of this software and associated documentation
53
5b0e96544a07
files (the "Software"), to deal in the Software without
54
5b0e96544a07
restriction, including without limitation the rights to use,
55
5b0e96544a07
copy, modify, merge, publish, distribute, sublicense, and/or sell
56
5b0e96544a07
copies of the Software, and to permit persons to whom the
57
5b0e96544a07
Software is furnished to do so, subject to the following
58
5b0e96544a07
conditions:
59
5b0e96544a07
60
5b0e96544a07
The above copyright notice and this permission notice shall be
61
5b0e96544a07
included in all copies or substantial portions of the Software.
62
5b0e96544a07
63
5b0e96544a07
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
64
5b0e96544a07
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
65
5b0e96544a07
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
66
5b0e96544a07
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
67
5b0e96544a07
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
68
5b0e96544a07
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
69
5b0e96544a07
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
70
5b0e96544a07
OTHER DEALINGS IN THE SOFTWARE.