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.12.beta.23 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.beta.22 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.beta.21 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.beta.20 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.beta.19 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.beta.18 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.beta.17 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.11.13 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.beta.16 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.beta.15 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.11.13.beta.4 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.11.13.beta.3 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.11.13.beta.2 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.beta.14 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.beta.13 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.beta.12 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.beta.11 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.12.beta.9 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.11.13.beta.1 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.11.13.beta.0 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb