I have a namespace and a couple tasks in the namespace that run after deploy:updated. Here is an example:
namespace :myservice do
task :start do
on roles(:app) do
sudo :start, "my/application"
end
end
end
I'd love for one of these tasks to only run on a certain environment or host property. How can I accomplish this?
I'd love to be able to filter on environment such as:
namespace :myservice do
task :start do
on roles(:app), env(:vagrant) do
sudo :start, "my/application"
end
end
end
What is the best way to accomplish this?