views:

180

answers:

1

I've read a lot about deploying applications here, but haven't found a suitable answer to our needs yet.

We have a large web application built with the zend framework that we want to deploy to a remote server. We want to be able to easily and safely deploy a new version of our application to our production server.

What needs to be done is the following:

  • put up a maintenance page on the production application?
  • export version from SVN
  • run a shell script to minify the CSS files in a certain directory (shell script is done)
  • set file permissions on files and directories
  • copy/sync? files to a production server -> only changed files?
  • remove maintenance page from the production application?

We use SVN as a code versioning tool and we are running CentOS as our server OS in production.

I've read about:

  • rsync
  • fredistrano / capistrano
  • phing
  • custom shell scripts

What are your advices for easy one-click deployment?

+1  A: 

I export (or checkout) a copy of the site under a different name (typically the subversion revision number & date) and symlink the document root into place

1000.20100515/
   application/
   public/
   library/
1020.20100621/
current (symlink to 1000.20100515/)
dev (symlink to 1020.20100621/)

# copy whatever 'dev' points to as the new 'current' symlink.
rm current && cp -d dev current

The document root is set in apache to ../current/public

With this, I can check out a new version of the site at leisure, and put the new version live en-mass in a fraction of a second. Rolling back to a previous version of the site is as easy as changing the symlink - should a major problem be found.

Alister Bulman
And how do you handle DB schema changes? That's where the fun starts :p.
wimvds
yup, would love to hear that as well. Dbdeploy?
Jorre
.... carefully.
Alister Bulman