My main reason for always using the standard deploy recipe (with an entire
clone/checkout/export/whatever) is that I want to be able to rollback any
deployment, but your way is totally doable.
If you write this kind of task you certainly will have to set the needed
callbacks associated with the update_code task (see
http://wiki.capify.org/index.php/Default_Execution_Path).
As I use svn I also don't want to clutter my deployed directories with multiple
useless .svn folders.
If speed is your concern you could use remote_cache or fast_remote_cache which
keeps a directory with a git clone which is updated when needed (not sure about
the exact strategy).
If storage space is your concern against the standard deploy task know that you
can use deploy:cleanup. For instance we use it within a callback after:deploy in
staging envs to avoid useless outdated deployed versions.
>
> On Mar 19, 8:52 am, Ian Sheridan <ian.sheri...@gmail.com> wrote:
>> Jean-Philippe is correct. You do NOT place static folders in your
>> release directories. You need to place the UPLOADS folder (or any
>> other folder like it that has static non-versioned files in it) in the
>> "shared" directory. You then create a task that makes a new symlink to
>> the UPLOADS directory.
>>
>> This flexibility is the heart and soul of Capistrano. You can get it
>> to do anything that you would need at any stage in your deployment
>> process. here is a sample task that creates a symlink:
>>
>> desc "create symlink"
>> task :db, :roles => [:app] do
>> send(run_method, "ln -nfs #{shared_path}/UPLOADS
>> #{current_path}/public/UPLOADS")
>> end
Not sure why you are using a run_method var here, run "ln ..." also works fine :)
Additionally you can have a :created_shared_directory(ies) with a callback on
deploy:setup that creates the needed folders in the shared/ directory.
run "ln -nfs #{shared_path}/UPLOADS #{current_path}/public/UPLOADS")
François, You will need to use the "Before" and "After" methods to
make sure that this new task that you will make gets executed at the
right time. As Jean-Philippe said you should have it run "After"
"deploy:symlink".
Good Luck
- ian
On Thu, Mar 19, 2009 at 12:23 PM, Jean-Philippe Moal
<skate...@skateinmars.net> wrote:
>> On Mar 19, 8:52 am, Ian Sheridan <ian.sheri...@gmail.com> wrote:
>>> desc "create symlink"
>>> task :db, :roles => [:app] do
>>> send(run_method, "ln -nfs #{shared_path}/UPLOADS
>>> #{current_path}/public/UPLOADS")
>>> end
>
> Not sure why you are using a run_method var here, run "ln ..." also works fine :)
>
> Additionally you can have a :created_shared_directory(ies) with a callback on
> deploy:setup that creates the needed folders in the shared/ directory.
--