Sha256: 5de92a446f83f3f76cc63abf475948de9bad91c84cf15b73c0356f11b796e2de

Contents?: true

Size: 1.19 KB

Versions: 240

Compression:

Stored size: 1.19 KB

Contents

namespace :appsignal do
  task :deploy do
    appsignal_env = fetch(:appsignal_env, fetch(:stage, fetch(:rails_env, fetch(:rack_env, "production"))))
    user = fetch(:appsignal_user, ENV["USER"] || ENV["USERNAME"])
    revision = fetch(:appsignal_revision, fetch(:current_revision))

    appsignal_config = Appsignal::Config.new(
      ENV["PWD"],
      appsignal_env,
      {},
      Logger.new(StringIO.new)
    ).tap do |c|
      fetch(:appsignal_config, {}).each do |key, value|
        c[key] = value
      end
      c.validate
    end

    if appsignal_config && appsignal_config.active?
      marker_data = {
        :revision => revision,
        :user => user
      }

      marker = Appsignal::Marker.new(marker_data, appsignal_config)
      # {#dry_run?} helper was added in Capistrano 3.5.0
      # https://github.com/capistrano/capistrano/commit/38d8d6d2c8485f1b5643857465b16ff01da57aff
      if respond_to?(:dry_run?) && dry_run?
        puts "Dry run: AppSignal deploy marker not actually sent."
      else
        marker.transmit
      end
    else
      puts "Not notifying of deploy, config is not active for environment: #{appsignal_env}"
    end
  end
end

after "deploy:finished", "appsignal:deploy"

Version data entries

240 entries across 240 versions & 1 rubygems

Version Path
appsignal-3.0.26-java lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-3.0.26 lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-3.0.25-java lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-3.0.25 lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-3.0.24-java lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-3.0.24 lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-3.0.23-java lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-3.0.23 lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-3.0.22-java lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-3.0.22 lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-3.0.21-java lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-3.0.21 lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-3.0.21.alpha.1-java lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-3.0.21.alpha.1 lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-3.0.20-java lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-3.0.20 lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-3.0.19-java lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-3.0.19 lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-3.0.18-java lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-3.0.18 lib/appsignal/integrations/capistrano/appsignal.cap