Source Control System Config
Configuration Information about Subversion setup
Most of the Subversion management can be handled by checking out the following repository, make changes in there and commit those back.
svn co https://scm.ops4j.org/repos/svn-admin
All relative directory and file references below are relative to that checked out directory.
User names and passwords
Usernames and passwords are obtained through the JIRA system, so when people are adding themselves as JIRA users, they automatically gets standard commit access, with the same username and password as in JIRA.
Users can also be added manually by running
htpasswd2 -b users.pwd <user-email-address> <user-password>
in the checked out svn-admin directory. Don't forget to add the user as a member of the active group in svn-authz-access.conf file.
WARNING: If the user change the password in JIRA, it will currently NOT be updated for Subversion. It is due to a missing event from JIRA, and we hope that Atlassian fixes this in the near future.
Authorization
New users are automatically added to the group named active, in the svn-authz-access.conf file. Additional groups exists, and people will be added to those manually. To modify this file, check it out to your desktop, change the file and commit the changes. A cron job running as user cron-scm, will update this every 5 minutes.
The special user cron-scm
The user cron-scm has a cron job that runs every 5 minutes.
- First it runs the /var/scm/cron/bootstrap.sh
- bootstrap.sh changes directory to $HOME/svn-admin, which is the checked out directory of the /repos/svn-admin repository.
- It makes a svn up and then goes into the cron/common directory and executes the start.sh script.
- The start.sh script takes over, and will execute all other scripts in the same directory.
- Current scripts are;
- update-auth.sh which updates the authorization of users.
- update-hooks.sh which updates the SVN hooks.
Hooks
The Subversion hook system is a powerful feature, and for our repositories, it is setup in a modular fashion to allow distributed management.
- Each Repository can have its own Svn hooks, located in <project>/svn-hooks
- For repository /repos/ops4j, it has a post-commit hook in ops4j/svn-hooks
- The hooks are run as user www-data.
- The hooks are updated once every hour.
- The default post-commit, calls the scripts/mailer.py, which is set up with one group per repository. Adding a new repository requires editing and committing the scrips/mailer.conf.
Creating a new repository
There should not be much need for separate Repositories inside OPS4J, but since the same Svn server is used to serve a few other repositories, and we have no other goof place to put it, here is the explaination of how to create a new repository.
- Log in as root.
- su - www-data
- cd /var/scm/repos
- svnadmin create <NameOfRepo>
- exit back to root.
- cd /var/scm/repos
- chown -R .svnadmin <NameOfRepo>
- chmod -R g+w <NameOfRepo>
That should ensure that the permissions are correctly set up.