| Subversion and svnsync and websvn | ||||
|
|
This tutorial shows how to syncronzie your own local repository with a remote repository and sync with it. The result shall be displayed in the websvn GUI. How to add basic security is shown in apache2 and basic security on this web site. ------------------------------------------------ Time to setup a local repository.Step 1 Create a local directory to store checked out files. mkdir /development/localcopy Step 2 Create a subversion repository. mkdir /development/repos/ svnadmin create /development/repos/svn Step 3 Check out (nothing) to localcopy cd /development/localcopy svn co file:///development/repos/svn/ Check to see that you have a .svn file in /development/localcopy (then you are home free) Ok so far what do we got. We have one local repository (shall be synked) and one place to put our checked out files. ------------------------------------------------------------------------------ Time to connect local repository with remoteLet us now sync our local repository with the remote repository. Let us assume our remote repository is https://svn.foo.bar.com/svn. Let us assume that there is a user svnuser and a password there svnpwd. Do like this. Edit this file vi /development/repos/svn/hooks/pre-revprop-change.tmpl and make it look like this;
and save it as /development/repos/svn/hooks/pre-revprop-change (that is without file ending) Go to the repository. cd /development/repos/svn svnsync init --username svnuser file:///development/repos/svn/ https://svn.foo.bar.com/svn This will set up the sync of your local repository. And now sync; svnsync sync file:///development/repos/svn/ This might take a while, but in the end your repository will be synchronized.
Time to connect svnweb with local repositoryEdit this websvn file. vi /usr/share/websvn/include/config.php Add this line.
$config->addRepository('NameToDisplay', 'file:///development/repos/svn'); Crontab jobHow do we make svnsync do it regulary, well a crontab job. Let's do it every 30 minutes. Create script to call from crontab and save it as sync.sh in /development/repository #!/bin/sh
chmod file to 755 Do this crontab -e add line */5 * * * * /development/repository/sync.sh |
|
| Last Updated ( Thursday, 24 June 2010 11:59 ) |


