Sha256: 9480f8123afbb7281c4fb2d532076207f6d2db2cf5c4734b196feba9e953a813

Contents?: true

Size: 949 Bytes

Versions: 10

Compression:

Stored size: 949 Bytes

Contents

require 'capistrano'
require 'appsignal'

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
            rails_env = fetch(:rails_env, 'production')
            user = ENV['USER'] || ENV['USERNAME']

            marker_data = {
              :revision => current_revision,
              :repository => repository,
              :user => user
            }

            marker = Marker.new(marker_data, ENV['PWD'], rails_env, logger)
            if config.dry_run
              logger.info("Dry run: Deploy marker not actually sent.")
            else
              marker.transmit
            end
          end
        end
      end
    end
  end
end

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
appsignal-0.6.7 lib/appsignal/capistrano.rb
appsignal-0.6.6 lib/appsignal/capistrano.rb
appsignal-0.6.5 lib/appsignal/capistrano.rb
appsignal-0.6.4 lib/appsignal/capistrano.rb
appsignal-0.6.3 lib/appsignal/capistrano.rb
appsignal-0.6.3.beta.3 lib/appsignal/capistrano.rb
appsignal-0.6.3.beta.2 lib/appsignal/capistrano.rb
appsignal-0.6.3.beta.1 lib/appsignal/capistrano.rb
appsignal-0.6.2 lib/appsignal/capistrano.rb
appsignal-0.6.1 lib/appsignal/capistrano.rb