Sha256: c3476c0f72ed297e4f78aea473012508f12a55272f754644599d02d4112bd9b6

Contents?: true

Size: 1.19 KB

Versions: 45

Compression:

Stored size: 1.19 KB

Contents

module Appsignal
  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))

            appsignal_config = Appsignal::Config.new(
              ENV['PWD'],
              env,
              fetch(:appsignal_config, {}),
              logger
            )

            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
            end
          end
        end
      end
    end
  end
end

if ::Capistrano::Configuration.instance
  Appsignal::Capistrano.tasks(::Capistrano::Configuration.instance)
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
appsignal-1.0.4 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-1.1.0.beta.6 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-1.0.3 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-1.0.3.beta.2 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-1.0.3.beta.1 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-1.1.0.beta.5 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-1.1.0.beta.4 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-1.1.0.beta.3 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-1.1.0.beta.2 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-1.1.0.beta.1 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-1.0.2 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-1.0.2.beta.4 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-1.0.2.beta.3 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-1.0.2.beta.2 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-1.0.2.beta.1 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-1.0.1 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-1.0.0 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-1.0.0.rc.1 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.rc.14 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.rc.13 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb