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 <n...@deadorange.com> 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 capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com 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 capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Reply via email to