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.9.6 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.9.5 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.10.0.beta.0 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.9.4 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.9.3 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.9.2 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.9.1 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.9.0 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.9.0.beta.1 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
appsignal-0.9.0.alpha.1 lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb