capfire 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/generators/capfire_generator.rb +4 -2
- data/lib/{capfire.rb → Capfire.rb} +0 -0
- data/lib/capfire/capistrano.rb +29 -18
- metadata +19 -7
data/Rakefile
CHANGED
@@ -9,13 +9,13 @@ begin
|
|
9
9
|
gem.description = %Q{Inspired by http://github.com/blog/609-tracking-deploys-with-compare-view}
|
10
10
|
gem.email = "junkiesxl@gmail.com"
|
11
11
|
gem.homepage = "http://github.com/pjaspers/Capfire"
|
12
|
-
gem.authors = ["pjaspers"]
|
12
|
+
gem.authors = ["pjaspers", "atog"]
|
13
13
|
gem.files = FileList['[A-Z]*',
|
14
14
|
'generators/**/*.*',
|
15
15
|
'lib/**/*.rb',
|
16
16
|
'lib/templates/*.erb']
|
17
17
|
gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
|
18
|
-
gem.add_dependency('broach', '>= 0.1
|
18
|
+
gem.add_dependency('broach', '>= 0.2.1')
|
19
19
|
end
|
20
20
|
Jeweler::GemcutterTasks.new
|
21
21
|
rescue LoadError
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
@@ -24,9 +24,11 @@ class CapfireGenerator < Rails::Generator::Base
|
|
24
24
|
campfire:
|
25
25
|
account: #{options[:campfire_account]}
|
26
26
|
token: #{options[:campfire_token]}
|
27
|
+
ssl: false
|
27
28
|
room: #{options[:chat_room]}
|
28
|
-
message: "I (#deployer#) deployed #application#
|
29
|
-
|
29
|
+
message: "I (#deployer#) deployed #application# with `cap #args#` (#compare_url#)"
|
30
|
+
cowsay: true
|
31
|
+
cow: random
|
30
32
|
CONF
|
31
33
|
unless campfire_file_exists?
|
32
34
|
File.open(File.join(ENV['HOME'],'.campfire'), 'w') do |out|
|
File without changes
|
data/lib/capfire/capistrano.rb
CHANGED
@@ -12,28 +12,39 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
12
12
|
namespace :deploy do
|
13
13
|
desc "Posting a message to Campfire"
|
14
14
|
task :notify_campfire do
|
15
|
-
source_repo_url = repository
|
16
|
-
deployer = Etc.getlogin
|
17
|
-
deploying = `git rev-parse HEAD`[0,7]
|
18
15
|
begin
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
16
|
+
source_repo_url = repository
|
17
|
+
deployer = Etc.getlogin
|
18
|
+
deploying = `git rev-parse HEAD`[0,7]
|
19
|
+
begin
|
20
|
+
deployed = previous_revision[0,7]
|
21
|
+
rescue
|
22
|
+
deployed = "000000"
|
23
|
+
end
|
24
|
+
puts "Posting to Campfire"
|
25
|
+
# Getting the github url
|
26
|
+
github_url = repository.gsub(/git@/, 'http://').gsub(/\.com:/,'.com/').gsub(/\.git/, '')
|
27
|
+
compare_url = "#{github_url}/compare/#{deployed}...#{deploying}"
|
28
|
+
|
29
|
+
# Reading the config file and drill in on the campfire section of course.
|
30
|
+
config = YAML::load(File.open(File.join(ENV['HOME'],'.campfire')))["campfire"]
|
27
31
|
|
28
|
-
|
29
|
-
|
32
|
+
# Ugly but it does the job.
|
33
|
+
message = config["message"].gsub(/#deployer#/, deployer).gsub(/#application#/, application).gsub(/#args#/, ARGV.join(' ')).gsub(/#compare_url#/,compare_url)
|
30
34
|
|
31
|
-
|
32
|
-
message = config["campfire"]["message"].gsub(/#deployer#/, deployer).gsub(/#application#/, application).gsub(/#args#/, ARGV.join(' ')).gsub(/#compare_url#/,compare_url)
|
35
|
+
message = `cowsay "#{message}"` if config["cowsay"]
|
33
36
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
+
# Posting the message.
|
38
|
+
Broach.settings = {
|
39
|
+
'account' => config["account"],
|
40
|
+
'token' => config["token"],
|
41
|
+
'use_ssl' => true
|
42
|
+
}
|
43
|
+
room = Broach::Room.find_by_name(config["room"])
|
44
|
+
room.speak(message)
|
45
|
+
rescue => e
|
46
|
+
puts e.message
|
47
|
+
end
|
37
48
|
end
|
38
49
|
end
|
39
50
|
end
|
metadata
CHANGED
@@ -1,29 +1,33 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capfire
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 21
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
9
|
+
- 1
|
10
|
+
version: 0.2.1
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- pjaspers
|
14
|
+
- atog
|
13
15
|
autorequire:
|
14
16
|
bindir: bin
|
15
17
|
cert_chain: []
|
16
18
|
|
17
|
-
date: 2010-
|
19
|
+
date: 2010-10-28 00:00:00 +02:00
|
18
20
|
default_executable:
|
19
21
|
dependencies:
|
20
22
|
- !ruby/object:Gem::Dependency
|
21
23
|
name: thoughtbot-shoulda
|
22
24
|
prerelease: false
|
23
25
|
requirement: &id001 !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
24
27
|
requirements:
|
25
28
|
- - ">="
|
26
29
|
- !ruby/object:Gem::Version
|
30
|
+
hash: 3
|
27
31
|
segments:
|
28
32
|
- 0
|
29
33
|
version: "0"
|
@@ -33,14 +37,16 @@ dependencies:
|
|
33
37
|
name: broach
|
34
38
|
prerelease: false
|
35
39
|
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
36
41
|
requirements:
|
37
42
|
- - ">="
|
38
43
|
- !ruby/object:Gem::Version
|
44
|
+
hash: 21
|
39
45
|
segments:
|
40
46
|
- 0
|
47
|
+
- 2
|
41
48
|
- 1
|
42
|
-
|
43
|
-
version: 0.1.4
|
49
|
+
version: 0.2.1
|
44
50
|
type: :runtime
|
45
51
|
version_requirements: *id002
|
46
52
|
description: Inspired by http://github.com/blog/609-tracking-deploys-with-compare-view
|
@@ -60,8 +66,10 @@ files:
|
|
60
66
|
- generators/capfire_generator.rb
|
61
67
|
- generators/lib/insert_commands.rb
|
62
68
|
- generators/templates/capistrano_hook.rb
|
63
|
-
- lib/
|
69
|
+
- lib/Capfire.rb
|
64
70
|
- lib/capfire/capistrano.rb
|
71
|
+
- test/helper.rb
|
72
|
+
- test/test_Capfire.rb
|
65
73
|
has_rdoc: true
|
66
74
|
homepage: http://github.com/pjaspers/Capfire
|
67
75
|
licenses: []
|
@@ -72,23 +80,27 @@ rdoc_options:
|
|
72
80
|
require_paths:
|
73
81
|
- lib
|
74
82
|
required_ruby_version: !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
75
84
|
requirements:
|
76
85
|
- - ">="
|
77
86
|
- !ruby/object:Gem::Version
|
87
|
+
hash: 3
|
78
88
|
segments:
|
79
89
|
- 0
|
80
90
|
version: "0"
|
81
91
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
92
|
+
none: false
|
82
93
|
requirements:
|
83
94
|
- - ">="
|
84
95
|
- !ruby/object:Gem::Version
|
96
|
+
hash: 3
|
85
97
|
segments:
|
86
98
|
- 0
|
87
99
|
version: "0"
|
88
100
|
requirements: []
|
89
101
|
|
90
102
|
rubyforge_project:
|
91
|
-
rubygems_version: 1.3.
|
103
|
+
rubygems_version: 1.3.7
|
92
104
|
signing_key:
|
93
105
|
specification_version: 3
|
94
106
|
summary: Send a notification to Campfire after a cap deploy
|