Project management: Trac

Table of Contents

Configuration
CGI script of Apache
Add repository

Add repository

by ross at 17:20:25 on November 29, 2011

Login to Trac as admin. Step through Admin menu, configuring the system.

Click Repositories, add your repository projectname, then:

# trac-admin /home/trac/projectname repository resync "projectname"

Create hooks

Install security/sudo, run visudo as root, add:

%projectname ALL=(projectname) NOPASSWD: /usr/local/bin/trac-admin

With the line above we allow users of group projectname to run trac-admin as user projectname (owner of /home/trac/projectname) without password.

Create /home/svn/repos/projectname/hooks/post-commit:

#!/bin/sh
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
export PYTHON_EGG_CACHE="/home/trac/projectname/.egg-cache"
sudo -u projectname trac-admin /home/trac/projectname changeset added "$1" "$2"
# chown svn:projectname /home/svn/repos/projectname/hooks/post-commit
# chmod 755 /home/svn/repos/projectname/hooks/post-commit

Create /home/svn/repos/projectname/hooks/post-revprop-change:

#!/bin/sh
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
export PYTHON_EGG_CACHE="/home/trac/projectname/.egg-cache"
sudo -u projectname trac-admin /home/trac/projectname changeset modified "$1" "$2"
# chown svn:projectname /home/svn/repos/projectname/hooks/post-revprop-change
# chmod 755 /home/svn/repos/projectname/hooks/post-revprop-change

 

Comments