Module: CapistranoNotification
- Defined in:
- lib/capistrano-notification.rb,
lib/capistrano-notification/version.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
'0.1.1'
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.extended(config) ⇒ Object
6 7 8 9 |
# File 'lib/capistrano-notification.rb', line 6 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
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/capistrano-notification.rb', line 75 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 |