Revisions
-
joelmoss revised this gist
Feb 15, 2012 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -43,16 +43,16 @@ def text(msg) puts "Missing .campfire.yml or ../.campfire.yml or ~/.campfire.yml with your API token, can't announce deploys." end ROOM = Room.new(config) if respond_to?(:config) end task :pre_announce do deploy.campfire ROOM.text "is deploying '#{application}' to #{stage}" if respond_to?(:ROOM) end task :post_announce do ROOM.text "finished deploying '#{application}' to #{stage}" if respond_to?(:ROOM) end end -
joelmoss revised this gist
Feb 15, 2012 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,7 +32,7 @@ def text(msg) namespace :deploy do task :campfire do yml1, yml2, yml3 = ".campfire.yml", "../.campfire.yml", "~/.campfire.yml" yml1, yml2, yml3 = File.expand_path(yml1), File.expand_path(yml2), File.expand_path(yml3) if File.exist?(yml1) config = YAML.load_file(yml1) elsif File.exist?(yml2) @@ -48,11 +48,11 @@ def text(msg) task :pre_announce do deploy.campfire ROOM.text "is deploying '#{application}' to #{stage}" if ROOM end task :post_announce do ROOM.text "finished deploying '#{application}' to #{stage}" if ROOM end end -
joelmoss revised this gist
Feb 15, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -43,7 +43,7 @@ def text(msg) puts "Missing .campfire.yml or ../.campfire.yml or ~/.campfire.yml with your API token, can't announce deploys." end ROOM = Room.new(config) if config end task :pre_announce do -
joelmoss revised this gist
Feb 15, 2012 . 2 changed files with 60 additions and 43 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,60 @@ # Put this at the bottom of your config/deploy.rb # Requires config file at .campfire.yml or ~/.campfire.yml or ../.campfire.yml # with your API token from your Campfire "My Info" page: # # token: lkjsadfsaduoi1u31oui3eh1kj2h # roomid: 123456 # subdomain: acmeco class Room attr_accessor :config def initialize(cfg) @config = cfg end def say(msg, type=:Paste) url = "https://#{config['subdomain']}.campfirenow.com/room/#{config['roomid']}" message = "<message><type>#{type}Message</type><body>#{msg}</body></message>" `curl -i -u #{config['token']}:X -H 'Content-Type: application/xml' -d '#{message}' #{url}/speak.xml` end def paste(msg) say msg end def text(msg) say msg, :Text end end namespace :deploy do task :campfire do yml1, yml2, yml3 = ".campfire.yml", "../.campfire.yml", "~/.campfire.yml" yml1, yml2, yml3 = File.expand_path(yml1), File.expand_path(yml3), File.expand_path(yml3) if File.exist?(yml1) config = YAML.load_file(yml1) elsif File.exist?(yml2) config = YAML.load_file(yml2) elsif File.exist?(yml3) config = YAML.load_file(yml3) else puts "Missing .campfire.yml or ../.campfire.yml or ~/.campfire.yml with your API token, can't announce deploys." end ROOM = Room.new(config) config end task :pre_announce do deploy.campfire ROOM.text "is deploying #{application} to #{stage}" if ROOM end task :post_announce do ROOM.text "finished deploying #{application} to #{stage}" if ROOM end end before "deploy", "deploy:pre_announce" after "deploy", "deploy:post_announce" This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,43 +0,0 @@ -
mperham revised this gist
Feb 14, 2012 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,6 +3,8 @@ # your Campfire "My Info" page: # # token: lkjsadfsaduoi1u31oui3eh1kj2h # roomid: 123456 # subdomain: acmeco class Room attr_accessor :config -
mperham revised this gist
Feb 14, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ class Room @config = cfg end def say(msg, type=:Paste) `curl -i -u #{config['token']}:X -H 'Content-Type: application/xml' -d '<message><type>#{type}Message</type><body>#{msg}</body></message>' https://#{config['subdomain']}.campfirenow.com/room/#{config['roomid']}/speak.xml` end def paste(msg); say(msg); end def text(msg); say(msg, :Text); end -
mperham created this gist
Feb 14, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,41 @@ # Put this at the bottom of your config/deploy.rb # Requires config file ~/.campfire.yml with your API token from # your Campfire "My Info" page: # # token: lkjsadfsaduoi1u31oui3eh1kj2h class Room attr_accessor :config def initialize(cfg) @config = cfg end def say(msg, type=:Paste) `curl -i -u #{config['token']}:X -H 'Content-Type: application/xml' -d '<message><type>#{type}Message</type><body>#{msg}</body></message>' https://theclymb1.campfirenow.com/room/440273/speak.xml` end def paste(msg); say(msg); end def text(msg); say(msg, :Text); end end namespace :deploy do task :campfire do yml = File.expand_path("~/.campfire.yml") if File.exist?(yml) config = YAML.load_file(yml) ROOM = Room.new(config) else puts "Missing ~/.campfire.yml with your API token, can't announce deploys." end end task :pre_announce do deploy.campfire ROOM.text "is deploying #{application} to #{stage}" if ROOM end task :post_announce do ROOM.text "finished deploying #{application} to #{stage}" if ROOM end end before "deploy", "deploy:pre_announce" after "deploy", "deploy:post_announce"