Module: CapistranoNotification
- Defined in:
- lib/capistrano-notification.rb
Defined Under Namespace
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.extended(config) ⇒ Object
5 6 7 8 |
# File 'lib/capistrano-notification.rb', line 5 def self.extended(config) config.set :local_user, ENV['USER'] || ENV['USERNAME'] || 'unknown' config.set :deploy_target, config.fetch(:stage, config.fetch(:rails_env, 'production')) end |
Instance Method Details
#add(notification) ⇒ Object
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/capistrano-notification.rb', line 70 def add(notification) task_name = notification.name.downcase.gsub(' ', '_') namespace :deploy do namespace :notify do desc "Notify #{name} of the deployment." task task_name, :roles => :app, :except => {:no_release => true} do if notification.valid? notification.run else $stderr.puts notification.errors. end end end end after 'deploy', "deploy:notify:#{task_name}" end |