Sha256: 68a8fc939af84471d5bb559a7cb65b4473f91c036130a92a855da2dd25b7b1dd
Contents?: true
Size: 1.35 KB
Versions: 23
Compression:
Stored size: 1.35 KB
Contents
require 'simple_deploy/notifier/campfire' module SimpleDeploy class Notifier def initialize(args) @config = SimpleDeploy.config @stack_name = args[:stack_name] @environment = args[:environment] @notifications = @config.notifications || {} end def send_deployment_start_message message = "Deployment to #{@stack_name} in #{@config.region} started." send message end def send_deployment_complete_message message = "Deployment to #{@stack_name} in #{@config.region} complete." attributes = stack.attributes if attributes['app_github_url'] message += " App: #{attributes['app_github_url']}/commit/#{attributes['app']}" end if attributes['chef_repo_github_url'] message += " Chef: #{attributes['chef_repo_github_url']}/commit/#{attributes['chef_repo']}" end send message end def send(message) @notifications.keys.each do |notification| case notification when 'campfire' campfire = Notifier::Campfire.new :stack_name => @stack_name, :environment => @environment campfire.send message end end end private def stack @stack ||= Stack.new :name => @stack_name, :environment => @environment end end end
Version data entries
23 entries across 23 versions & 1 rubygems