Im sure there's a stage variable set either in the env or in the stage file
itself.
so you could do something like:
task :start, :roles => :app do
case ENV['STAGE']
when 'production'
...
when 'staging'
....
else
....
end
end
If all else fails just set a stage cap var in each stage file.
set :stage, 'production'
Then in the task
...
case stage
...
On Nov 27, 2011, at 8:14 AM, Nick Hoffman <[email protected]> wrote:
> Hey guys. Is it possible to assign a task to specific stages?
>
> I thought the :stages option might work, but it didn't change Capistrano's
> behaviour:
>
> desc "Start Foreman"
> task :start, :roles => :app, :stages => %w(production) do
> # ...
> end
> --
> * You received this message because you are subscribed to the Google Groups
> "Capistrano" group.
> * To post to this group, send email to [email protected]
> * To unsubscribe from this group, send email to
> [email protected] For more options, visit this group at
> http://groups.google.com/group/capistrano?hl=en
--
* You received this message because you are subscribed to the Google Groups
"Capistrano" group.
* To post to this group, send email to [email protected]
* To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/capistrano?hl=en