tags:

views:

1145

answers:

5

There's another post on SO relating to .NET -- not us. Pure PHP. Trying to find the best way/process to deploy stable version of our PHP app. I've seen an article on Capistrano, but am curious what else is out there. Aside from the obvious reasons, I'm also looking to add some scripting so that the SVN rev number gets added in there as well.

Much thanks.

+2  A: 

I've used a home-grown script for quite some time. It will (based on an application configuration file):

  1. Run svn export on the repository based on a tag.
  2. Package the export into a tar or zip file, which includes the tag in the name.
  3. Use scp to copy the package to the appropriate server (QA or release).
  4. Connect to the server with ssh to install the package and run post-install scripts.

The application configuration file is part of the project. It can tell the script (at step 2) to strip paths and otherwise process specified files. It also specifies server names and how to handle externals.

I've recently migrated the script to support Git as well as Subversion. I'm also probably going to migrate it to PHP since we're now running in a mixed (Linux and Windows) set up, with Linux now in the minority.

I have plans to automatically call the script with post-commit hooks, but haven't had the need to implement that just yet.

Michael Johnson
+1  A: 

I don't know if it works for deploying an app live, but phpUnderControl is a continuous integration suite (which I'm just now starting to look into). If it doesn't support doing deployments natively, it can probably be extended to do them.

Michael Johnson
I've been setting up a deployment script just like the one you mentioned (I plan to release mine in some capacity on github) and have it setup and working with phpUnderControl and it works like a charm. I can ONLY deploy after a successful build, it's nice.
Steven Surowiec
A: 

Chris Hartjes has a nice view on this: Deployment is not a 4 letter word

Gustavo Carreno
+1  A: 

Coincidentally, I was just reading about an Apache Ant/gnu make like build tool called Phing. What I like about it is the ability to write custom extensions in PHP!

Nick Stinemates
Seconded - I have really enjoyed Phing since we've started using it.
leek
That seems interesting and could be really handy, so thanks(!), but could you _please_ not misuse the word "ironically". It was coincidental that you were reading about this. </grammar-nazi>
nickf
+1  A: 

We're using Webistrano, which is a web frontend for Capistrano, to deploy a few dozen projects. It's built as a Ruby on Rails app, and provides a nice, centralized and consistent user interface for Capistrano deployments.

Instead of having cap recipes in every project, and running command-line tools, Webistrano stores the recipes in its database, and allows you to attach the recipes to multiple projects and stages. This reduces duplication of scripts.

Also nice is that all deployment logs are stored so there's an auditing trail. Who deployed which revision to the live server, that sort of thing.

As you requested, the Revision number is stored in the deployed project as well.

All in all, we're very pleased with it.

Martijn Heemels