Posts Tagged ‘ubuntu’
Keep in mind this is based on MY development and deployment environment, in your environment things will be a bit different.
{esc} = Press escape key.
{everything else} = Needs changed for your project or case.
Do not type # hash or anything after it.
Where it says “root> ” you may also assume “admin_user> sudo ” if you like to use protection.
Create new svn user:
root> htpassd -m /etc/apache2/dav_svn.passwd {username} # will ask for password twice
Create svn project:
root> cd /path/to/svn/repo/root root> svnadmin create {project name} root> chown -R www-data: ./{project name}
First import for project:
user> mkdir svn_{project}_core user> cd svn_{project}_core user> mkdir trunk user> mkdir tags user> mkdir branches user> cd trunk user> cp -r /path/to/existing/files/ ./ # repeat for . files in root direcotry (.htaccess for example) user> cd .. user> svn import -m 'Initial Import' ./ http://hostname.or.ip/svn/project # system will ask for svn username and password
Checkout project to web location:
root> su - www-data www-data> cd /var/www/sites/{project}/ # directory must be blank, delete contents and . files if not # directory must be owned by www-data user www-data> svn co http://hostname.or.ip/svn/{project} ./
Create auto publish post commit hook:
root> cd /path/to/svn/repo/{project}/hooks root> ls post-commit # if file does not exist: root> touch post-commit root> vim post-commit i #!/bin/sh /usr/bin/svn update /var/www/sites/{project} --username www-data --password ************ {esc} :wq root> chown www-data: post-commit root> chmod +x post-commit # if file exists: root> vim post-commit :9999999 o /usr/bin/svn update /var/www/sites/{project} --username www-data --password ************ {esc} :wq
Test post-commit hook:
root> cd /path/to/svn/repo/{project}/hooks root> su - www-data www-data> env - ./post-commit # errors will be reported
Add project to websvn:
root> cd /path/to/websvn/web/root/include/ root> vim config.php /Local o $config->addRepository('{project name}', 'file:///path/to/svn/repo/{project}'); {esc} :wq # Load websvn in browser and see project.
Enjoy, I will post ‘Misc subversion commands and information vol 2′ in a few weeks.
Terry Valladon (The Dirty Troll)Edits:
Fixed name of password file (was missing .passwd)




