tags:

views:

54

answers:

2

I have been looking at a couple of systems (Phing, ControlTier) and have also read all relevant questions on this site however I'm not sure I have found the best solution for my requirements.

I have a PHP website which is essentially a codebase for a price comparison shopping site. This is then deployed to many different servers, each of which has their own theme and database according to the products sold. When changes or bugfixes are made to the code base, this then needs pushing out to each server, with a typical workflow (backup, deploy, test, rollback / commit). Ideally I'd like to use something existing to achieve this rathe rthan rolling my own however may look at that option.

A future version of the system may support running multiple sites from a single codebase however that is currently not possible, partly as I have inherited a lot of the code, and also as my SEO team assure me that having multiple servers and IPs is a good thing.

Any advice as to the best setup for this type of deployment is much appreciated.

A: 

http://vimeo.com/13441373 Is a talk about Phing which may be a useful tool for you ... automated running of tasks defined in PHP. Haven't used it myself but the guy giving this talk knows his stuff.

James
+1  A: 

Phing can do alot of things for you in few lines of (configuration) code. I take it you allready have an implementation in place that deals with the "themabelity" of the different instances of your codebase?

You yould use phing to implement 3 simple commands, each automating the manual work involved with deploying.

Lets call the first one "phing stage" It will fetch from SVN when a svn commit happens, using svn hooks (lets say only when a new tag gets created as "/myrepos/tags/2/2.1.7") so that it could be part of a simple continuous integration. So the svn up COULD happen at a staging server where you run final tests on your ready-to-ship code (phpunit, frontend, manual ..).

If you are content with the results you could trigger "phing deploy" which backups your data on alle servers, then copies over the code that has been checked out and tested in the step above. SCP-tasks are available in phing but you need the php ssh2 extension (PECL module)

If everything is right you can stop, but if you have to "roll back" you could implement a "phing rollback" which copies over from the backup.

should be straightforward.

You can iterat your servers and have different variables filled or mapped if you like "Server1" -> "themeblue" "Server2" -> "themered" and copy over only the theme diretcories or config files that you need to enable the right style.

People that know Ant can work with phing too but phing has the advantage that it is very easy to deploy. Its extensability is a real plus too. You know php? You can write a new action or a filter that you can reuse in future deployment-scenarious.

I would give phing a go if I were you.

Oh and feel free to join #phing on freenode. Its quite empty but we can change that ;)

Christoph Strasen