Sha256: bed5d5c886a540df545f00f6ff82092bba9c8b08553a104af0945d618815d9a1

Contents?: true

Size: 954 Bytes

Versions: 2

Compression:

Stored size: 954 Bytes

Contents

# Defines deploy:notify_errornot which will send information about the deploy to Errornot.

Capistrano::Configuration.instance(:must_exist).load do
  after "deploy",            "deploy:notify_errornot"
  after "deploy:migrations", "deploy:notify_errornot"

  namespace :deploy do
    desc "Notify Errornot of the deployment"
    task :notify_errornot, :except => { :no_release => true } do
      rails_env = fetch(:errornot_env, fetch(:rails_env, "production"))
      local_user = ENV['USER'] || ENV['USERNAME']
      executable = RUBY_PLATFORM.downcase.include?('mswin') ? 'rake.bat' : 'rake'
      notify_command = "#{executable} errornot:deploy TO=#{rails_env} REVISION=#{current_revision} REPO=#{repository} USER=#{local_user}"
      notify_command << " API_KEY=#{ENV['API_KEY']}" if ENV['API_KEY']
      puts "Notifying Errornot of Deploy (#{notify_command})"
      `#{notify_command}`
      puts "Errornot Notification Complete."
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
errornot_notifier-1.0.1 lib/errornot_notifier/capistrano.rb
errornot_notifier-1.0.0 lib/errornot_notifier/capistrano.rb