Sha256: c7520b21126e8f68b90d7e6714326153263939355bb9a36491033a04bfa8cb33

Contents?: true

Size: 1.18 KB

Versions: 4

Compression:

Stored size: 1.18 KB

Contents

namespace :airbrake do
  desc <<-DESC
    Notify Airbrake of the deployment by running the notification on the REMOTE machine.
      - Run remotely so we use remote API keys, environment, etc.
  DESC
  task :deploy do
    # update scm state to get the repository information
    invoke "#{scm}:update"
    on roles(:all) do
      within release_path do
        # XXX: Invoking deploy:set_rails_env would set :rails_env to proper
        # value, but that would make us depend on capistrano-rails
        with rails_env: fetch(:rails_env, fetch(:stage)) do
          # Compose the command notify_command
          airbrake_env = fetch(:airbrake_env, fetch(:rails_env, fetch(:stage)))
          notify_command = "airbrake:deploy"
          notify_command << " TO=#{airbrake_env}"
          notify_command << " REVISION=#{fetch(:current_revision)} REPO=#{fetch(:repo_url)}"
          notify_command << " USER=#{local_user.strip.shellescape}"
          notify_command << " API_KEY=#{ENV['API_KEY']}" if ENV['API_KEY']

          info "Notifying Airbrake of Deploy (#{notify_command})"
          execute :rake, notify_command
          info "Airbrake Notification Complete."
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
airbrake-4.3.1 lib/airbrake/tasks/airbrake.cap
airbrake-4.3.0 lib/airbrake/tasks/airbrake.cap
airbrake-4.2.1 lib/airbrake/tasks/airbrake.cap
airbrake-4.2.0 lib/airbrake/tasks/airbrake.cap