Sha256: b526f571cc3a99c78ce35e3209d369e6495a0d269cf349160fa586e3694ce5d9

Contents?: true

Size: 1.28 KB

Versions: 11

Compression:

Stored size: 1.28 KB

Contents

namespace :load do

  task :defaults do

    set :bugsnag_default_hooks, ->{ true }

  end

end

namespace :deploy do

  before :starting, :bugsnag_hooks do
    invoke 'bugsnag:add_default_hooks' if fetch(:bugsnag_default_hooks)
  end

end

namespace :bugsnag do

  task :add_default_hooks do
    after 'deploy:published', 'bugsnag:deploy'
  end

  desc 'Notify Bugsnag that new production code has been deployed'
  task :deploy do
    run_locally do
      begin
        Bugsnag::Deploy.notify({
          :api_key => fetch(:bugsnag_api_key, ENV["BUGSNAG_API_KEY"]),
          :release_stage => fetch(:bugsnag_env) || ENV["BUGSNAG_RELEASE_STAGE"] || fetch(:rails_env) || fetch(:stage) || "production",
          :revision => fetch(:current_revision, ENV["BUGSNAG_REVISION"]),
          :repository => fetch(:repo_url, ENV["BUGSNAG_REPOSITORY"]),
          :branch => fetch(:branch, ENV["BUGSNAG_BRANCH"]),
          :app_version => fetch(:app_version, ENV["BUGSNAG_APP_VERSION"]),
          :endpoint => fetch(:bugsnag_endpoint, Bugsnag::Configuration::DEFAULT_ENDPOINT),
          :use_ssl => fetch(:bugsnag_use_ssl, true)
        })
      rescue
        error "Bugsnag deploy notification failed, #{$!.inspect}"
      end

      info 'Bugsnag deploy notification complete.'
    end
  end

end
# vi:ft=ruby

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
bugsnag-5.5.0 lib/bugsnag/tasks/bugsnag.cap
bugsnag-5.4.1 lib/bugsnag/tasks/bugsnag.cap
bugsnag-5.4.0 lib/bugsnag/tasks/bugsnag.cap
bugsnag-5.3.3 lib/bugsnag/tasks/bugsnag.cap
bugsnag-5.3.2 lib/bugsnag/tasks/bugsnag.cap
bugsnag-5.3.1 lib/bugsnag/tasks/bugsnag.cap
bugsnag-5.3.0 lib/bugsnag/tasks/bugsnag.cap
bugsnag-5.2.0 lib/bugsnag/tasks/bugsnag.cap
bugsnag-5.1.0 lib/bugsnag/tasks/bugsnag.cap
bugsnag-5.0.1 lib/bugsnag/tasks/bugsnag.cap
bugsnag-5.0.0 lib/bugsnag/tasks/bugsnag.cap