Install Subversion
sudo apt-get install subversion
Create a directory to hold the repositories
mkdir -p /home/pi/repos
Create a new repository
svnadmin create /home/pi/repos/<repo name>
Import a project to svn repository
sudo svn import /home/pi/projects/<project to import> file://localhost/home/pi/repos/<repo name>
Install apache
sudo apt-get install apache2 libapache2-svn
Modify the file /etc/apache2/mods-available/dav_svn.conf
add the following to the file
<Location /svn>
DAV svn
SVNParentPath /home/pi/repos
AuthType Basic
AuthName "Subversion Repo"
AuthUserFile /etc/apache2/dav_svn.passwd
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
</Location>
Restart Apache to pick up the config
sudo /etc/init.d/apache2 restart
Change the permissions of the repos directory
sudo chown -R www-data:www-data /home/pi/repos
Set up an svn user
sudo htpasswd -c /etc/apache2/dav_svn.passwd <username>
go to http://<ip of pi>/svn/<project name> and you should be able to see the revision of the project in the browser
Create a new repository
svnadmin create /home/pi/repos/<repo name>Import the new project into the repo
sudo svn import /home/pi/<new project> file://localhost/home/pi/repos/<new repo>Change the permissions of the repo
sudo chown -R www-data:www-data /home/pi/reposCheck out the project
svn co --username <username> http://localhost/svn/<project name>
No comments:
Post a Comment