Using SVN for web development
Here at my new workplace, there are more than 20 web apps that are being developed in-house. They go through the following workflow: devs use development and staging servers for tests, and after QA, the new builds are pushed to the production servers.
They've employed a custom version control system for coding, but it's not panning out. They need an automated way of pushing updates to the dev and staging servers for a quicker turn-around time.
Enter Subversion. I've used Subversion both in production and in personal projects. (I haven't used CVS so I can't compare the two.) The way I see it, the web apps can be pushed this way:
Easy so far. I've also added an HTTP URL for the SVN repos using Apache's WebDAV extensions. In
Restart the service. Now the repo can be accessed via
But I hit a snag: I can't get the
They've employed a custom version control system for coding, but it's not panning out. They need an automated way of pushing updates to the dev and staging servers for a quicker turn-around time.
Enter Subversion. I've used Subversion both in production and in personal projects. (I haven't used CVS so I can't compare the two.) The way I see it, the web apps can be pushed this way:
- Install SVN with WebDAV support.
- Create the repositories' directory trees:
mkdir /path/to/repository/projectname
- Note that the repositories have to be owned and writeable by the
httpduser:chown -R httpd:httpd /path/to/repository/projectname;
chmod g+s /path/to/repository/projectname - Create the SVN repositories:
svnadmin create /path/to/repository/projectname
- Import the current working directories for the projects:
svn import /path/to/working/project/dir \
file:///path/to/repository/projectname - Remove the working directories (backup first):
rm -rf /path/to/working/project/dir
- Check out directory trees from the repo:
svn co file:///path/to/repository/projectname
- Edit and commit changes:
svn ci
- Or, pull changes:
svn update /path/to/working/project/dir
Easy so far. I've also added an HTTP URL for the SVN repos using Apache's WebDAV extensions. In
httpd.conf, just add the following:
LoadModule dav_svn_module modules/mod_dav_svn.so
DAV svn
SVNParentPath /path/to/repo/root
Restart the service. Now the repo can be accessed via
http://reposerver/repos/projectname.But I hit a snag: I can't get the
post-commit hook to run on commits! I'm leaning on problems with the permissions, but it's eluding me right now. *sigh*
LoadModule dav_svn_module modules/mod_dav_svn.so
ReplyDeleteDAV svn
SVNParentPath /path/to/repo/root
You also can use svn ssh://url/repositorypath to skip dav