views:

166

answers:

1

Hi all,

Im in the process of looking for a way to streamline the deployment of one of our php web applications (if it works on this ill roll it out to other apps).

I quite like the look of this: http://www.springloops.com/, but its SVN and were using mercurial.

Unfortunately we have no shell access to our current server, so something that works over ftp would be best, if anyone has any ideas?

+3  A: 

You'll want to use mercurial's hg archive command from a hook. It takes a snapshot of the revision you indicate (via tag, etc.) and then exports it.

In your "production" repository's hgrc you could have something like this:

[hooks]
changegroup = ./doDeploy.sh

and then ./doDeploy.sh would have in it:

hg archive -r tip /tmp/deployme
ftp /tmp/deployme ftp://remoteserver

You'll end up having to work around all sorts of little glitches like file permissions, files that have been deleted from the repo but still exist on the server, etc. but in general that provides a good framework for a system that, upon having changes pushed to it by a release manager automatically uploads a snapshot to alive system.

Ry4an
Im assuming on a windows system this would just be bat file instead?
richzilla
That's certainly possible, or you can do it inprocess in python. See chapter 10 of the free mercurial book for details.
Ry4an