lib/airbrake/capistrano/tasks.rb in airbrake-5.0.0 vs lib/airbrake/capistrano/tasks.rb in airbrake-5.0.1
- old
+ new
@@ -4,10 +4,11 @@
if defined?(Capistrano::VERSION) &&
Gem::Version.new(Capistrano::VERSION).release >= Gem::Version.new('3.0.0')
namespace :airbrake do
desc "Notify Airbrake of the deploy"
task :deploy do
- on roles(:all) do
+ role = roles(:all, select: :primary).first || roles(:all).first
+ on role do
within release_path do
with rails_env: fetch(:rails_env, fetch(:stage)) do
execute :rake, <<-CMD
airbrake:deploy USERNAME=#{Shellwords.shellescape(local_user)} \
ENVIRONMENT=#{fetch(:rails_env, fetch(:stage))} \