This version of redmine-gitolite was tested with Redmine 2.0.2 only. It may work with other versions of 2.0 branch but will fail for sure with Redmine 1.x
This is Redmine Gitolite Hook combined with redmine-gitolite
A Redmine plugin which manages your gitolite configuration based on your projects and user memberships in Redmine.
Provides Gitolite hook, for automaticaly pulling changes to local clone of repository. This plugin will create local clone and keep it up to date.
Includes Public Key management views (extracted from http://plan.io).
- Gitolite server
- curl
- Install gitolite for user git. In home directory of user git
$ git clone https://github.com/sitaramc/gitolite.git $ mkdir bin $ echo "PATH=$HOME/bin:$PATH" >> .bashrc $ gitolite/install -ln $ gitolite setup -pk redmine.pub
redmine.pub must be the key generated for user running redmine so it will be possible for this user to clone repos locally (see next point)
- User running redmine (his key must be named named “redmine”) must have RW+ access to gitolite-admin (assuming that you have gitolite installed).
- Install Redmine and put this plugin into path_to_redmine/plugins
directory and migrate database (plugins)
$ cd redmine/plugins $ git clone git://github.com/pibako/redmine-gitolite.git redmine_gitolite $ cd redmine-gitoline $ git checkout -t origin/redmine2 $ cd ../../ $ RAILS_ENV=production rake redmine:plugins:migrate
- Make sure that redmine user has gitolite server in his known_host list i.e. ssh to git@your_host and accept
- Configure email and name of git user for your redmine account
$ git config --global user.email "[email protected]" $ git config --global user.name "Redmine Gitolite"
- Add post-receive hook to common gitolite hooks (example in
contrib dir) and configure it (host, api key, etc, see sources)
$ sudo su - gitolite #login on gitolite user $ cd /tmp $ git clone git://github.com/pibako/redmine-gitolite.git $ git checkout -t origin/redmine2 $ cp /tmp/redmine-gitolite/contrib/hooks/post-receive-redmine_gitolite ~/.gitolite/hooks/common/post-receive $ chmod +x .gitolite/hooks/common/post-receive $ emacs .gitolite/hooks/common/post-receive
- enable WS for repository management in [Administration -> Settings -> Repositories]
- copy generated API key
- configure, in complex hook you can do this by git config options
- edit .gitolite.rc
add "hooks\.redmine_gitolite\..*" to the GIT_CONFIG_KEYS setting $ gitolite setup
- Configure plugin in redmine settings [Adminitration -> Plugins ->
Redmine Gitolite]
- Gitolite URL should be set to your gitolite-admin git repository
- Base path should point directory which will hold local copies (must exist)
- Set developer and ro urls as in given examples
- %{name} will be replaced with your repository identifier
- You should manage your keys only from Redmine to avoid conflicts.
- Need new bare git repo? Create it via Redmine, disable other features.
- This is most convenient way to manage keys by your user.