I'm been able to make use of the basic capistrano-ext multistage
functionality and deploy common tasks based on environment
successfully, but what I'm aiming to do is to customize the deployment
tasks that get invoked based on the environment. That is to say, I can
customize behaviour based on the variables I set in the stage (ie:
development/staging/production) task , but I would also like to
customize behaviour a bit further using after: hooks.
In response to my initial post you replied
-- snip --
Just put your before/after declarations in the corresponding stage
file.
E.g., in config/deploy/production.rb, say:
after "deploy:update", "upload_static_assets_to_s3"
etc.
-- snip --
which, if it worked, would have answered my question.
Buoyed by your reply, I added some tasks to my main deploy.rb file and
aimed to customize my deployment by adding some after
"deploy:update_code" hooks to the stage files in config/deploy/ -- eg.
my development.rb invokes the task that links the attachment-fu folder
to a folder on the filesystem, whereas staging.rb and production.rb
both call the task that configures attachment-fu for S3.
As I tried to communicate in my earlier post (on Thu, 16 Apr 2009), it
doesn't seem as if the stage files are actually being loaded. I'm not
sure how to get capistrano to recognize the files generated by cap
multistage:prepare.
Is there a problem with the approach of 1. defining all tasks in
deploy.rb then 2. customizing deployments for specific environments
using hooks in the appropriate stage file ?
- Ivar