crushserver 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +2 -2
- data/crushserver.gemspec +3 -3
- data/lib/crushserver/recipes.rb +27 -11
- metadata +5 -5
data/VERSION.yml
CHANGED
data/crushserver.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{crushserver}
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["PJ Kelly", "Mason Browne"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-08-12}
|
13
13
|
s.description = %q{A collection of capistrano tasks frequently used at Crush + Lovely.}
|
14
14
|
s.email = %q{pj@crushlovely.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -27,7 +27,7 @@ Gem::Specification.new do |s|
|
|
27
27
|
]
|
28
28
|
s.homepage = %q{http://github.com/crushlovely/crushserver}
|
29
29
|
s.require_paths = ["lib"]
|
30
|
-
s.rubygems_version = %q{1.
|
30
|
+
s.rubygems_version = %q{1.5.2}
|
31
31
|
s.summary = %q{A collection of capistrano tasks frequently used at Crush + Lovely.}
|
32
32
|
|
33
33
|
if s.respond_to? :specification_version then
|
data/lib/crushserver/recipes.rb
CHANGED
@@ -66,23 +66,35 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
|
+
desc "Send a message to the campfire chat room about the deploy start"
|
70
|
+
task :snitch_start do
|
71
|
+
message = "#{ENV['USER'].upcase} is deploying #{application.upcase}. Please stand by..."
|
72
|
+
set :snitch_message, message
|
73
|
+
snitch
|
74
|
+
end
|
75
|
+
|
69
76
|
desc "Send a message to the campfire chat room about the deploy end"
|
70
77
|
task :snitch_end do
|
71
|
-
|
72
|
-
|
78
|
+
revisions
|
79
|
+
message = <<HERE
|
80
|
+
#{application.upcase} was deployed to #{stage.to_s.upcase} by #{ENV['USER'].upcase} (#{branch}/#{real_revision[0, 7]})
|
81
|
+
|
82
|
+
#{revisions_result}
|
83
|
+
HERE
|
84
|
+
set :snitch_message, message
|
73
85
|
snitch
|
74
86
|
end
|
75
87
|
end
|
76
88
|
|
77
89
|
desc "Show currently deployed revision on server."
|
78
90
|
task :revisions, :roles => :app do
|
91
|
+
result = String.new
|
79
92
|
begin
|
80
93
|
current, previous, latest = current_revision[0,7], previous_revision[0,7], real_revision[0,7]
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
puts "=== Previous Revision: \033[1;32m#{previous}\033[0m\n\n"
|
94
|
+
result << "===== Master Revision: \033[1;33m#{latest}\033[0m\n\n"
|
95
|
+
result << "===== [ \033[1;36m#{application} - #{stage}\033[0m ]"
|
96
|
+
result << "=== Deployed Revision: \033[1;32m#{current}\033[0m"
|
97
|
+
result << "=== Previous Revision: \033[1;32m#{previous}\033[0m\n\n"
|
86
98
|
|
87
99
|
# If deployed and master are the same, show the difference between the last 2 deployments.
|
88
100
|
base_label, new_label, base_rev, new_rev = latest != current ? \
|
@@ -96,20 +108,24 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
96
108
|
diff = " " << diff.gsub("\n", "\n ") << "\n"
|
97
109
|
# Indent commit messages nicely, max 80 chars per line, line has to end with space.
|
98
110
|
diff = diff.split("\n").map{|l|l.scan(/.{1,120}/).join("\n"<<" "*14).gsub(/([^ ]*)\n {14}/m,"\n"<<" "*14<<"\\1")}.join("\n")
|
99
|
-
|
100
|
-
|
111
|
+
result << "=== Difference between #{base_label} revision and #{new_label} revision:\n\n"
|
112
|
+
result << diff
|
101
113
|
end
|
102
114
|
rescue
|
103
|
-
|
115
|
+
result << "=== Revisions Task Failed!"
|
104
116
|
end
|
117
|
+
set :revisions_result, result
|
105
118
|
end
|
106
119
|
|
107
120
|
#############################################################
|
108
121
|
# Hooks
|
109
122
|
#############################################################
|
110
123
|
|
124
|
+
before :deploy do
|
125
|
+
campfire.snitch_start unless ENV['QUIET'].to_i > 0
|
126
|
+
end
|
127
|
+
|
111
128
|
after :deploy do
|
112
129
|
campfire.snitch_end unless ENV['QUIET'].to_i > 0
|
113
|
-
revisions
|
114
130
|
end
|
115
131
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crushserver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 4
|
10
|
+
version: 0.3.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- PJ Kelly
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-
|
19
|
+
date: 2011-08-12 00:00:00 -07:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
82
|
requirements: []
|
83
83
|
|
84
84
|
rubyforge_project:
|
85
|
-
rubygems_version: 1.
|
85
|
+
rubygems_version: 1.5.2
|
86
86
|
signing_key:
|
87
87
|
specification_version: 3
|
88
88
|
summary: A collection of capistrano tasks frequently used at Crush + Lovely.
|