Project

General

Profile

Plugins Directory » Redmine Bitbucket

Author: Steve Qian
Website: https://bitbucket.org/steveqian/redmine_bitbucket
Code repository: https://bitbucket.org/steveqian/redmine_bitbucket
Registered on: 2012-11-19 (about 12 years ago)
Current version: 1.1.0
Compatible with: Redmine 3.2.x, 3.1.x, 3.0.x, 2.6.x, 2.5.x, 2.4.x, 2.3.x, 2.2.x, 2.1.x, 2.0.x
User ratings:   (4)

This plugin allows you to update your local repositories in Redmine when changes have been pushed to Bitbucket.

Redmine <http://redmine.org> has supported Git/Hg 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 Git/Hg repositories.

The Redmine Bitbucket 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.

Assumptions
  • Redmine running on a *nix-like system.
  • Git 1.6 or higher available on the commandline.

This plugin is inspired by Redmine Github Hook from Jakob Skjerning ( http://github.com/koppen/redmine_github_hook )

Installation notes

1. Installing the plugin

  • Copy redmine_bitbucket plugin to {redmine_root}/plugins on your redmine path
  • Run 'bundle install RAILS_ENV=production'
  • Run 'rake redmine:plugins NAME=redmine_bitbucket RAILS_ENV=production'
  • Restart Redmine.
  • Configure Local repositories path (default is {redmine_root}/bitbucket_repos) at Administration > Plugins >Redmine Bitbucket plugin, and make sure the folder is writable by web server user.
  • Configure SSH key for the web server user if need to pull from private repositories. (https://confluence.atlassian.com/display/BITBUCKET/Using+the+SSH+protocol+with+bitbucket)
  • You may need to drop to shell and su to your web server user and type ssh to prompt to accept host key before it works in the background.
  • (optional) Configure the secret key

2. Connecting Bitbucket to Redmine * On bitbucket.org, go to the repository Admin interface (the sprocket icon). * Under "hooks" add a new hook of type "POST" using the format: "[redmine_installation_url]/hooks/bitbucket/:project_id(?key=[***])" (for example "http://example.com/hooks/bitbucket/example_project?key=supersecret"). * Note: since v1.0 of this plugin, the POST url has changed to hooks/bitbucket/:project_id, which is not backwards compatible.

That's it. Bitbucket will now send a HTTP POST to the Redmine Bitbucket plugin whenever changes are pushed to Bitbucket. A new local repository will be created with Bitbucket's repository name as the identifier on first request. Then pull changes to the local repository and updating the Redmine database with them. Auto cloning can be disable under plugin setting, which only updating will be performed.

Changelog

1.1.0 (2015-10-14)

Compatible with Redmine 3.2.x, 3.1.x, 3.0.x, 2.6.x, 2.5.x, 2.4.x, 2.3.x, 2.2.x, 2.1.x, 2.0.x.

Added support for the new Bitbucket Webhooks

1.0.0 (2014-08-15)

Compatible with Redmine 2.5.x, 2.4.x, 2.3.x, 2.2.x, 2.1.x, 2.0.x.

- Add Japenese language support
- Changed the post hook url to 'hooks/bitbucket/:project_id'
Please change the hooks in bitbucket after upgrade to this version.

0.2.0 (2013-09-15)

Compatible with Redmine 2.4.x, 2.3.x, 2.2.x, 2.1.x, 2.0.x.

using scm command in Redmine configuration.

Thanks to Yuji Hanamura (https://bitbucket.org/yuji_developer) for the contribution.

0.1.0 (2012-11-19)

Compatible with Redmine 2.1.x, 2.0.x.

fixed a issue with key validation.

User ratings

  by Mehdi Achour almost 8 years ago

Here's the fixed link for the repository:
https://bitbucket.org/steveqian/redmine_bitbucket

  by Jonatan Magnusson about 8 years ago

This plugin (version 1.0.0) does what it says and has been running very stable for years.

But when I needed to use it on a new Redmine installation I found that the Bitbucket repository link is dead. Is it still available somewhere?

  by Deepak Gautam almost 10 years ago

Installation went OK. But only a directory with the name that matches bitbucket repo name is created under bitbucket_repos folder. Files could not be cloned. I couldn't find the way to get id_rsa from openshift console. My redmine is in openshift.

  by Woody Huang about 10 years ago

This just saved my life~~

Note this:

"http://example.com/hooks/bitbucket/example_project?key=supersecret" instead of # to parse secret key.