SVN REPOSITORY SERVER AND SYNCHRONIZATION
apt-get install apache2 subversion libapache2-mod-svn libsvn-dev
mkdir -p /var/lib/svn/
svnadmin create /var/lib/svn/myrepo
chown -R www-data:www-data /var/lib/svn
chmod -R 775 /var/lib/svn
touch /etc/apache2/dav_svn.passwd
htpasswd -m /etc/apache2/dav_svn.passwd admin
New password:
Re-type new password:
htpasswd -m /etc/apache2/dav_svn.passwd user1
New password:
Re-type new password:
on file /etc/apache2/mods-enabled/dav_svn.conf
DAV svn
SVNParentPath /var/lib/svn
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd
Require valid-user
restart the Apache service to apply the new configuration
service apache2 restart
[[http://***.168.56.129/svn/myrepo/]]
Create a new svn-templates project directory.
mkdir -p ~/svn-templates/{trunk,branches,tags}
Add templates directory to the repository using the svn command below.
svn import -m 'Initial import' ~/svn-templates/ file:///var/lib/svn/myrepo/ --username admin --password Qwe12345!
nano /var/lib/svn/myrepo/hooks/pre-revprop-change on master
#!/bin/sh
REVISION=${2}
# Launch (backgrounded) sync jobs for each slave server.
svnsync copy-revprops http://**.226.179.206/svn/myrepo ${REVISION} &
svnsync copy-revprops http://**.226.179.207/svn/myrepo ${REVISION} &
exit 0
nano /var/lib/svn/myrepo/hooks/post-commit on master
#!/bin/sh
# Launch (backgrounded) sync jobs for each slave server.
svnsync sync --username admin --password Qwe12345! http://**.226.179.206/svn/myrepo &
svnsync sync --username admin --password Qwe12345! http://**.226.179.207/svn/myrepo &
chmod +x /var/lib/svn/myrepo/hooks/pre-revprop-change on master
chmod +x /var/lib/svn/myrepo/hooks/post-commit on master
svnsync init --username admin --password Qwe12345! http://**.226.179.208/svn/myrepo --allow-non-empty file:///var/lib/svn/myrepo/ ${REVISION}
svnsync init --username admin --password Qwe12345! http://**.226.179.206/svn/myrepo --allow-non-empty file:///var/lib/svn/myrepo/ ${REVISION}
svnsync init --username admin --password Qwe12345! http://**.226.179.207/svn/myrepo --allow-non-empty file:///var/lib/svn/myrepo/ ${REVISION}
svnsync sync --username admin --password Qwe12345! http://**.226.179.207/svn/myrepo
svnsync sync --username admin --password Qwe12345! http://**.226.179.206/svn/myrepo