Building a website from a SVN repository
I wanted to find a way to quickly copy the latest versions of files from an SVN repository to a website using a batch file that could be run on a moment’s notice.
I’ve removed some details, but the gist of it is:
@echo off
set path=%path%;C:\Program Files\CollabNet\Subversion Client
svn checkout https://xxx.unfuddle.com/svn/xxx_xxx/ –username xxx –password xxx
xcopy xxx_xxx\xxx\*.* C:\inetpub\wwwroot\demo.xxx.com /s /Y
erase xxx_xxx /s /q
rmdir /s /q xxx_xxx
This gets the latest version of a project from an SVN repo (Unfuddle), copies it to a temp folder, xcopies the files to the website folder, then deletes the temp folder.
Unfortunately, it gets all files, rather than just changed files, but I found that since the checkout was being done via a high-speed server-to-server connection, the speed to download the files was much faster than getting the files to my local machine and uploading them, despite the fact there were many more files. In any case, it was damn fast.