Outils pour utilisateurs

Outils du site


en:computing:network_system:installation_d_un_serveur_gitolite_redmine

Ceci est une ancienne révision du document !


References :

Install needed packages

First install thin web server, gitolite for git hosting and redmine to manage your project.

$ sudo apt-get install gitolite redmine thin

Install plugin

To make gitolite and redmine able to exchange, we need to add a plugin to redmine. Clone the plugin from github.

$ cd /usr/share/redmine/vendor/plugins/
$ sudo git clone git://github.com/gdoffe/redmine-gitolite.git

Add ruby dependancies.

$ sudo gem install net-ssh lockfile ruby-openid
$ sudo gem install gitolite --pre

Configuration

Launch redmine and plugins database init.

sudo RAILS_ENV=production rake db:migrate_plugins
sudo RAILS_ENV=production rake db:migrate_plugins
sudo RAILS_ENV=production rake redmine:load_default_data

Configure thin web server to listen for redmine requests.

$ sudo thin config -C /etc/thin/redmine.yml -c /usr/share/redmine --servers 1 -e production --user redmine --group www-data --port 8080

Create a folder where the plugin will store the git repositories.

$ sudo mkdir /var/cache/redmine/repositories

Create a special user gitolite which will be used by the redmine plugin to talk with gitolite.

$ sudo addgroup gitolite
$ sudo adduser --disabled-password --home /home/gitolite --ingroup gitolite gitolite

As gitolite application uses ssh to access git repositories, generate your ssh keys to be administrator.

This is the Linux user account that will be the first administrator of your gitolite server. Note it carefully, we will need it later.

$ ssh-keygen -t rsa
$ cp ~/id_rsa.pub /tmp/<mon_login>.pub

Now log in as gitolite user to launch gitolite setup process.

$ sudo su - gitolite
$ gl-setup /tmp/<mon_login>.pub

Copy a git hook to keep redmine projects synchronised with git repositories.

$ cp /usr/share/redmine/vendor/plugins/redmine-gitolite/contrib/hooks/post-receive-redmine_gitolite .gitolite/hooks/common/post-receive

Now edit .gitolite/hooks/common/post-receive file to set DEFAULT_REDMINE_KEY and DEFAULT_REDMINE_SERVER as in redmine settings. Respectively API Key et Host name and path.

Enable WS for repository management must be checked in order to generate the API key.

Default login/password for redmine administration is admin/admin .

Delete hooked flag from all repositories and re-launch setup to propagate the hook.

$ rm `find repositories/ -name gitolite-hooked -print`
$ gl-setup

Create a user who runs redmine (here we call him redmine) and generate his SSH keys.

$ exit
$ sudo addgroup redmine
$ sudo adduser --disabled-password --system --ingroup redmine --home /usr/share/redmine/ redmine
$ sudo chown redmine.redmine /usr/share/redmine -Rf
$ sudo chown redmine.www-data /var/cache/redmine/ -Rf
$ sudo chown redmine.www-data /var/log/redmine/ -Rf
$ sudo su - redmine
$ ssh-keygen -t rsa

Next copy his public key to a temporary place.

$ cp ~/.ssh/id_rsa.pub /tmp/redmine.pub

Create log folder for the web server.

$ mkdir ~/log

Initialize git ids, name and email.

$ git config --global user.name "Redmine"
$ git config --global user.email ""

Go back to the account able to administrate gitolite to modify its configuration.

$ exit
Cloner le repo de configuration de **gitolite**
$ cd /tmp
$ git clone gitolite@localhost:gitolite-admin
$ cd gitolite-admin/

Copy in the project gitolite-admin the public key from the user running redmine. Add this user name to the repositories access configuration file.

This key must be named redmine.pub and thus the user rtunning redmine must be also called redmine in the gitolite configuration file conf/gitolite.conf.

$ cp /tmp/redmine.pub keydir/
$ git add keydir/redmine.pub
$ vim conf/gitolite.conf

conf/gitolite.conf file :

repo    gitolite-admin
        RW+     =   admdev
        RW      =   redmine

repo    testing
        RW+     =   @all

Commit your modifications and push them to the server.

$ git commit -a -m "Add root user public key. Add RW access to gitolite-admin repo for root user."
$ git push

Restart web server and that's all.

$ sudo service thin restart
en/computing/network_system/installation_d_un_serveur_gitolite_redmine.1331215579.txt.gz · Dernière modification: 2012/09/20 10:53 (modification externe)