lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb in appsignal-0.12.rc.7 vs lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb in appsignal-0.12.rc.8
- old
+ new
@@ -1,45 +1,43 @@
module Appsignal
- module Integrations
- class Capistrano
- def self.tasks(config)
- config.load do
- after 'deploy', 'appsignal:deploy'
- after 'deploy:migrations', 'appsignal:deploy'
+ class Capistrano
+ def self.tasks(config)
+ config.load do
+ after 'deploy', 'appsignal:deploy'
+ after 'deploy:migrations', 'appsignal:deploy'
- namespace :appsignal do
- task :deploy do
- env = fetch(:rails_env, fetch(:rack_env, 'production'))
- user = ENV['USER'] || ENV['USERNAME']
- revision = fetch(:appsignal_revision, fetch(:current_revision))
+ namespace :appsignal do
+ task :deploy do
+ env = fetch(:rails_env, fetch(:rack_env, 'production'))
+ user = ENV['USER'] || ENV['USERNAME']
+ revision = fetch(:appsignal_revision, fetch(:current_revision))
- appsignal_config = Appsignal::Config.new(
- ENV['PWD'],
- env,
- fetch(:appsignal_config, {}),
- logger
- )
+ appsignal_config = Appsignal::Config.new(
+ ENV['PWD'],
+ env,
+ fetch(:appsignal_config, {}),
+ logger
+ )
- if appsignal_config && appsignal_config.active?
- marker_data = {
- :revision => revision,
- :user => user
- }
+ if appsignal_config && appsignal_config.active?
+ marker_data = {
+ :revision => revision,
+ :user => user
+ }
- marker = Marker.new(marker_data, appsignal_config, logger)
- if config.dry_run
- logger.info('Dry run: Deploy marker not actually sent.')
- else
- marker.transmit
- end
+ marker = Marker.new(marker_data, appsignal_config, logger)
+ if config.dry_run
+ logger.info('Dry run: Deploy marker not actually sent.')
+ else
+ marker.transmit
end
end
end
end
end
end
end
end
if ::Capistrano::Configuration.instance
- Appsignal::Integrations::Capistrano.tasks(::Capistrano::Configuration.instance)
+ Appsignal::Capistrano.tasks(::Capistrano::Configuration.instance)
end