views:

1564

answers:

4

For my web application running on LAMP, I need to be able to deploy database migrations and code changes on multiple servers and be able to test deployment afterwards, all of this automatically done by scripts.

Currently I'm torn between using directly my build tool (Phing) with some special deployment/test tasks, or shell scripts, or a scripting language like Ruby or Python.

The problem is that I feel that a build tool should be used to build, not to deploy. I also feel that shell scripts are hard to maintain and not very readable.

Do you have any good advice on this subject ?

A: 

What have I used?

  • svn post-commit hook
  • shell script to rsync
  • perl cgi script to svn switch across systems

It doesn't seem like any of these would be acceptable for you though, given your statement "I also feel that shell scripts are hard to maintain and not very readable."

Ray
I actually plan to use rsync and svn hooks but with as little shell scripts as possible. :)
Franck
+2  A: 

A lot of people here on stackoverflow seem to really like Capistrano.

Peter Bailey
Thanks for the suggestion, I will check how it integrates into a PHP environment.
Franck
+3  A: 

For PHP projects, Phing is the way to go. Deployment is definitely one of its intended usage, considering that in PHP there isn't any "real" build process - as scripts are not compiled.

From the official site:

If you find yourself writing custom scripts to handle the packaging, deploying, or testing of your applications, then we suggest looking at the Phing framework.

Phing can do everything shell/python/ruby scripts can do, and can be extended in PHP which is its major draw for PHP developers. Why would you want to use ruby/python if you are a PHP developer?

Eran Galperin
Actually, I'm willing to use the best tool for the job, not use PHP everywhere just because i'm using it for my application. It might be convenient to some developers who only know PHP though. I will dig more into Phing to see if it fits my needs.
Franck
I've been using it mainly as deployment tool and it works great. SVN updates, directory permissions, test runner, you name it, it fits the bill :)
Eran Galperin
+1  A: 

To deploy web applications, PHP or other, in some click, you can use fredistrano.