Sha256: 8fec8db482696988f30bfec79f91cda6325453e404eaebb0614fd2c6fee81acd

Contents?: true

Size: 1.3 KB

Versions: 110

Compression:

Stored size: 1.3 KB

Contents

module Appsignal
  module Integrations
    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
end

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

Version data entries

110 entries across 110 versions & 1 rubygems

Version Path
appsignal-0.11.18 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.rc.7 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.rc.6 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.rc.5 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.beta.54 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.beta.53 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.beta.52 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.beta.51 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.11.17 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.beta.50 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.beta.49 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.11.16 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.beta.48 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.beta.47 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.beta.46 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.beta.45 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.beta.44 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.beta.43 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.beta.42 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.beta.41 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb