Revisions and synchronisation

One added benefit of version control is the fact that the changelog gives you a list of everything you've changed since the last time you wrote up the project log. Commit early and commit often works well on this basis; besides fine-grained revision control the changelog is particularly detailed.



The results of this frequent commit strategy can now also be found on this site; the project now has a functional export procedure which can best be described by looking at the export script, with some added comments:

cd /home/wechsler/exports
rm -rf trunk
#Change to the export directory and wipe out the last instance

svn export file:///var/lib/svn/repository/phase.org/trunk
svnlook youngest /var/lib/svn/repository/ > trunk/VERSION
svn log -r1:HEAD file:///var/lib/svn/repository/phase.org/trunk > trunk/docs/CHANGELOG
#Export the latest code version to the current directory
#Find the latest version number and dump it to a file
#Dump the changelog file into the export tree

cd trunk && tar -cvzf ../phase-svn`cat VERSION`.tgz * && cd ..
#Zip the export into a tarball marked with the latest version number

mkdir -p trunk/frontend/files
cp phase-svn`cat trunk/VERSION`.tgz trunk/frontend/files/
svn log -r1:HEAD file:///var/lib/svn/repository/phase.org/trunk > trunk/frontend/files
#Copy the tarball into the export files directory and dump the changelog there too

rsync --exclude '.svn' -ave ssh /home/wechsler/exports/trunk/ wechsler@tenrei.phase.org:domains/phase.org
#Synchronise the contents of the export directory with the live directory on the server



It's an fairly efficient method. Only one password is needed for uploading and rsync means that only the changes are uploaded, and the live site's config files (not present in the export) are preserved. The only hack is the method for extracting the latest version number. As far as I can tell, there's no way to get this data via the normal 'svn' application.



You might notice that there's a gap in the version numbers in the changelog. This is an artefact of Subversion's numbering scheme; as I've been doing some work in another branch (to package up the SPF tools for transfer to another server).



As for the current code state, the group management code is pretty much done, and so the way is clear to start porting functionality over from the first generation code at InfinitePenguins.Net (which will make the source available for public use). That server's having a bit of a load issue at the moment, but you'll be able to see what's on the list when it returns. Comments as to which functionality readers would find useful are welcome.

Posted by parsingphase, 2004-06-13 21:06

Anonymous user

Login

Blog

Contact

I'm currently available for contract work in London as a Senior PHP Developer. Contact me for a CV, rates, or a chat.

Twitter @parsingphase
Email richard@phase.org
Github parsingphase
LinkedIn Richard George
Flickr parsingphase