capistrano-helpers 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.0
1
+ 0.7.1
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{capistrano-helpers}
8
- s.version = "0.7.0"
8
+ s.version = "0.7.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Scott Woods", "Clinton Judy"]
@@ -4,10 +4,28 @@ require 'tinder'
4
4
  require 'git'
5
5
 
6
6
  CapistranoHelpers.with_configuration do
7
-
7
+
8
8
  namespace :deploy do
9
9
  desc 'Make a post to campfire to tell everyone about this deployment.'
10
- task :post_to_campfire do
10
+ task :post_to_campfire_before do
11
+ config_file = [fetch(:campfire_config, 'config/campfire.yml'), "#{ENV['HOME']}/.campfire.yml"].detect { |f| File.readable?(f) }
12
+ if config_file.nil?
13
+ puts "Could not find a campfire configuration. Skipping campfire notification."
14
+ else
15
+ if ! exists?(:application)
16
+ puts "You should set :application to the name of this app."
17
+ end
18
+ git_config = Git.open('.').config rescue {}
19
+ someone = ENV['GIT_AUTHOR_NAME'] || git_config['user.name'] || `whoami`.strip
20
+ target = fetch(:stage, 'production')
21
+ config = YAML::load_file(config_file)
22
+ campfire = Tinder::Campfire.new(config['subdomain'], :token => config['token'])
23
+ room = campfire.find_room_by_name(config['room'])
24
+ room.speak("#{someone} started deploying #{application} #{branch} to #{target}")
25
+ end
26
+ end
27
+
28
+ task :post_to_campfire_after do
11
29
  config_file = [fetch(:campfire_config, 'config/campfire.yml'), "#{ENV['HOME']}/.campfire.yml"].detect { |f| File.readable?(f) }
12
30
  if config_file.nil?
13
31
  puts "Could not find a campfire configuration. Skipping campfire notification."
@@ -21,11 +39,11 @@ CapistranoHelpers.with_configuration do
21
39
  config = YAML::load_file(config_file)
22
40
  campfire = Tinder::Campfire.new(config['subdomain'], :token => config['token'])
23
41
  room = campfire.find_room_by_name(config['room'])
24
- room.speak("#{someone} just deployed #{application} #{branch} to #{target}")
25
- room.leave
42
+ room.speak("#{someone} finished deploying #{application} #{branch} to #{target}")
26
43
  end
27
44
  end
28
45
  end
29
- after "deploy:restart", "deploy:post_to_campfire"
46
+ after "deploy:restart", "deploy:post_to_campfire_after"
47
+ before "deploy", "deploy:post_to_campfire_before"
30
48
 
31
- end
49
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 7
8
- - 0
9
- version: 0.7.0
8
+ - 1
9
+ version: 0.7.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Scott Woods
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-04-16 00:00:00 -04:00
18
+ date: 2012-05-09 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency