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.0.rc.1 lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-3.0.0.rc.1-java lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-2.11.9-java lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-2.11.9 lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-2.11.8-java lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-2.11.8 lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-2.11.7 lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-2.11.7-java lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-2.11.6 lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-2.11.6-java lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-3.0.0.beta.1 lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-3.0.0.beta.1-java lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-2.11.5-java lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-2.11.5 lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-2.11.4-java lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-2.11.4 lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-2.11.3-java lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-2.11.3 lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-2.11.2-java lib/appsignal/integrations/capistrano/appsignal.cap
appsignal-2.11.2 lib/appsignal/integrations/capistrano/appsignal.cap