Really simple Redmine plugin, that exposes repository refresh calls.
Ruby
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app/controllers
config
spec
tasks
MIT-LICENSE
README
Rakefile
init.rb

README

Redmine Refresh Repository API Plugin
====================

A simple Redmine plugin that exposes repository refresh calls.

By default, Redmine does not automatically refresh commits from the repository. This can be fixed by adding a script that uses rails' script/runner to invoke Redmine commands to a Cron job or, if your set-up allows, to a post-commit hook. In some situations, these solutions just don't cut it. This plugin is designed to enable a remote (SCM) server to trigger repository refreshes in Redmine via HTTP.

Installing this plugin adds the following routes to your Redmine installation:

http://your.redmine-installation.org/repositories/refresh/project-identifier
http://your.redmine-installation.org/repositories/refresh/project-identifier.xml

GETting or POSTing to these will trigger Redmine to fetch the latest commits from the given repository.

Usage
=======

Put the `refresh_repository_api’ directory inside the vendor/plugins directory of your Redmine installation and restart the server.
The most elegant way to do this, is to use Rails’ plugin script. Inside your Redmine installation directory, perform:

script/plugin install git://github.com/micheljansen/refresh_repository_api_plugin.git

And restart the server.

Note that this line installs the latest version of the refresh_repository_api_plugin. If you are running redmine 0.8 stable, you'll want to install the the 0.1.0 version of this plugin as follows:

script/plugin install -r "tag 0.1.0" git://github.com/micheljansen/refresh_repository_api_plugin.git

Create a post-commit hook in your SCM. How exactly this works depends on your SCM, but it usually boils down to creating a shell script containing the actions to perform. For a Subversion repository, it suffices to put:

#!/bin/sh
curl http://your.redmine-installation.org/repositories/refresh/project-identifier.xml?key=YOUR_KEY_HERE
as an executable file called “post-commit” inside the hooks directory of your repository database.

The API relies on Redmine’s RSS keys to work. For a logged-in user, these can be found in any of the “Also available in: Atom” links throughout the Redmine User Interface. If, for instance, the link at the bottom of the Projects screen says:
http://your.redmine-installation.org/projects.atom?key=1fdfd238a475216c39a2160917bcf95954c7608e
then 1fdfd238a475216c39a2160917bcf95954c7608e is your key and you should put it instead of YOUR_KEY_HERE.

It is safest to create a new user for this, but you can also use an existing account. Whichever you choose, make sure the user has rights to "Refresh changesets". This can be found in the "Roles and permissions" administration screen.

Copyright (c) 2009 Michel Jansen, released under the MIT license
http://micheljansen.org/projects/redmine-refresh-repository-api-plugin
http://github.com/micheljansen/refresh_repository_api_plugin