views:

22

answers:

1

I am trying to automate deployments of a particular project and a bit lost as to who to handle config file as well as user assets. (Application is based on Zend Framework based btw).

Main application folder is structured as follows:

./app
     ./config.ini   <----- config file
     ./modules
     ./controllers
     ./models
     ./views
./libs
./public

That config file is where all the configs are stored. So 'app' folder contains whole bunch of code in PHP and 'public' contains whole bunch of code in JavaScript, HTML/CSS and stuff like that(web accessible basically).

If I follow Capistrano's model, where each package is expanded into it's own folder that is then symlinked to, how do I handle that config.ini file? What about all the user content that is uploaded into ./public folder?

Thanks!

+1  A: 

The Capistrano approach to this is to have a structure like this on your remote server:

releases/
    20100901172311/
    20101001101232/
    [...]
current/ (symlink to current release)
shared/

in the shared directory you include your config file and any user generated content (e.g. shared/files). Then on each deployment, once you've checked out the code you automatically create symlinks from the checkout into your relevant shared directories. E.g.:

releases/20101001101232/public/files -> shared/files
releases/20101001101232/application/configs/config.ini -> shared/config.ini

that way, when a user uploads a file to public/files it is actually being stored in shared/files.

Tim Fountain