[lang]

Present Perfect

Personal
Projects
Packages
Patches
Presents
Linux

Picture Gallery
Present Perfect

website update

Filed under: General — Thomas @ 00:52

2007-02-28
00:52

Every once in a while I come back to thinking about what the ideal setup would be to manage and develop web sites. My wish list, as always, is:

  • have a separate development and live copy online
  • have the ability to have a local development copy (on my host)
  • track these versions in a version control system
  • make it as easy as possible to update
  • make it as easy as possible to downgrade the live version back to a previously working version
  • ideally, all updates can be made without touching the server (if it's just code)

In the past, I mostly used a custom shell script to release from the dev version to the live version. Basically, it would copy over the whole dev tree, then it would copy over specific files in a specific subpath to make up the live tree.

This has served me well in the past, but in the end it is too much hassle and I rarely updated my website because of it. Doing a "release" of a website does not reflect the real-world need of continuously updating websites.

I finally decided to do the most obvious thing, but with a twist:

  • my subversion repository has a dev/ and www/ subdirectory
  • www/ is branched from dev/
  • post-commit hooks on the server automatically update either dev/ or www/ depending on which got commited to (using svnlook)
  • I use svnmerge.py - and only svnmerge.py ! - to merge groups of changes from dev to www. I only pull a complete set of patches from dev so that every commit to www results in a working site.

So, the workflow is now much simpler.

  • Hack as much as I want on a local copy, in a local checkout, on a local machine, inside the dev/ tree
  • When I want to test on the live machine, commit to the dev/ tree and check the auto-updated online copy
  • Repeat until the online copy works
  • svnmerge.py merge on the www/ branch to pull changes from the dev/ branch
  • svn commit -F svnmerge-commit-message.txt to update the live copy

Update: just used this complete system to hack in my first actual change to the website.  For the longest time, my lists had no markers because I removed them using CSS, because I disliked having them on the right where the categories list is shown.  My lack of CSS skills combined with the arduous hacking cycle stopped me from getting it right.  So yes, this system is much easier.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

picture