Sha256: af9193f9265b42e209185f9b193ad2db87e90cfa798be095dd68fe5f5d593af4

Contents?: true

Size: 1.15 KB

Versions: 19

Compression:

Stored size: 1.15 KB

Contents

require 'capistrano'

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']

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

              marker_data = {
                :revision => current_revision,
                :repository => repository,
                :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::Integrations::Capistrano.tasks(::Capistrano::Configuration.instance)
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
appsignal-0.8.3.beta.0 lib/appsignal/integrations/capistrano.rb
appsignal-0.8.2 lib/appsignal/integrations/capistrano.rb
appsignal-0.8.1 lib/appsignal/integrations/capistrano.rb
appsignal-0.8.1.beta.4 lib/appsignal/integrations/capistrano.rb
appsignal-0.8.1.beta.3 lib/appsignal/integrations/capistrano.rb
appsignal-0.8.1.beta.2 lib/appsignal/integrations/capistrano.rb
appsignal-0.8.1.beta.1 lib/appsignal/integrations/capistrano.rb
appsignal-0.8.1.beta.0 lib/appsignal/integrations/capistrano.rb
appsignal-0.8.0 lib/appsignal/integrations/capistrano.rb
appsignal-0.8.0.beta.1 lib/appsignal/integrations/capistrano.rb
appsignal-0.8.0.beta.0 lib/appsignal/integrations/capistrano.rb
appsignal-0.8.0.alpha.0 lib/appsignal/integrations/capistrano.rb
appsignal-0.7.1 lib/appsignal/integrations/capistrano.rb
appsignal-0.7.1.beta.1 lib/appsignal/integrations/capistrano.rb
appsignal-0.7.0.beta.1 lib/appsignal/integrations/capistrano.rb
appsignal-0.7.0.alpha.4 lib/appsignal/integrations/capistrano.rb
appsignal-0.7.0.alpha.3 lib/appsignal/integrations/capistrano.rb
appsignal-0.7.0.alpha.2 lib/appsignal/integrations/capistrano.rb
appsignal-0.7.0.alpha.1 lib/appsignal/integrations/capistrano.rb