cloud-utils 1.0 → 1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +3 -1
- data/Manifest +1 -1
- data/Rakefile +2 -1
- data/bin/deploy +14 -10
- data/bin/monitor +10 -5
- data/cloud-utils.gemspec +3 -3
- data/cloud-utils.tmproj +185 -3
- data/etc/monitor.yml +1 -1
- data/lib/cloud/deploy/monitor.rb +2 -1
- metadata +5 -5
data/CHANGELOG
CHANGED
data/Manifest
CHANGED
data/Rakefile
CHANGED
@@ -2,7 +2,8 @@ require 'echoe'
|
|
2
2
|
|
3
3
|
Echoe.new('cloud-utils') do |pkg|
|
4
4
|
pkg.author = 'J. Brisbin'
|
5
|
-
pkg.email = 'jon@jbrisbin.com'
|
5
|
+
pkg.email = 'jon@jbrisbin.com'
|
6
|
+
pkg.version = '1.1'
|
6
7
|
pkg.summary = 'Deploy artifacts in a cloud environment.'
|
7
8
|
pkg.url = 'http://github.com/jbrisbin/cloud-utils-deployer'
|
8
9
|
pkg.runtime_dependencies = ['amqp >=0.6.7']
|
data/bin/deploy
CHANGED
@@ -36,15 +36,19 @@ optparse.parse!
|
|
36
36
|
|
37
37
|
config = YAML.load_file(options[:config])
|
38
38
|
|
39
|
-
ARGV.
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
artifact.
|
39
|
+
if !ARGV.nil?
|
40
|
+
ARGV.each do |arg|
|
41
|
+
artifact = Cloud::Deploy::Artifact.new
|
42
|
+
artifact.name = arg
|
43
|
+
artifact.uri = config[arg]['source']
|
44
|
+
artifact.local_paths = config[arg]['destination']
|
45
|
+
artifact.unzip = config[arg]['unzip']
|
46
|
+
artifact.force = options[:force]
|
47
|
+
artifact.use_etags = options[:etags]
|
48
|
+
if artifact.outdated?
|
49
|
+
artifact.deploy!
|
50
|
+
end
|
49
51
|
end
|
52
|
+
else
|
53
|
+
$log.debug("warn") { "No artifacts to deploy!" }
|
50
54
|
end
|
data/bin/monitor
CHANGED
@@ -43,10 +43,12 @@ em_thread = Thread.new { EM.run }
|
|
43
43
|
# Use the name coming in on the command line or all of the configured names
|
44
44
|
names = Hash.new
|
45
45
|
if ARGV.size > 0
|
46
|
-
$log.info('
|
47
|
-
|
46
|
+
$log.info('monitor') { "Was passed artifacts to deploy, so using those: #{ARGV.join(', ')}" }
|
47
|
+
ARGV.each do |arg|
|
48
|
+
names[arg] = {}
|
49
|
+
end
|
48
50
|
else
|
49
|
-
$log.info('
|
51
|
+
$log.info('monitor') { "Deploying all configured artifacts" }
|
50
52
|
names.replace(config)
|
51
53
|
names.delete_if { |k, v| k == "default" }
|
52
54
|
end
|
@@ -61,16 +63,19 @@ em_thread.join(options[:timeout])
|
|
61
63
|
|
62
64
|
# Finish processing
|
63
65
|
Cloud::Deploy.load_md5sums do |md5s|
|
66
|
+
$log.debug('monitor') { "#{monitors.length} monitors configured" }
|
64
67
|
monitors.each do |mon|
|
65
68
|
if !mon.artifact.nil?
|
66
69
|
deploy_cmd = config[mon.name][:deploy] % mon.artifact
|
67
|
-
already_seen = md5s[mon.md5sum].nil?
|
70
|
+
already_seen = !md5s[mon.md5sum].nil?
|
68
71
|
if !options[:force] and already_seen
|
69
72
|
$log.info(mon.name) { "MD5 sums match, so not deploying again" }
|
70
73
|
else
|
71
|
-
$log.info(mon.name) { "Deploying: #{mon.artifact} with hash: #{mon.md5sum} using: #{deploy_cmd}" }
|
74
|
+
$log.info(mon.name) { "Deploying: #{mon.artifact} with hash: #{mon.md5sum} using: '#{deploy_cmd}'" }
|
72
75
|
`#{deploy_cmd}`
|
73
76
|
end
|
77
|
+
else
|
78
|
+
$log.info('monitor') { "No artifacts to deploy!" }
|
74
79
|
end
|
75
80
|
end
|
76
81
|
end
|
data/cloud-utils.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{cloud-utils}
|
5
|
-
s.version = "1.
|
5
|
+
s.version = "1.1"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["J. Brisbin"]
|
9
|
-
s.date = %q{2010-
|
9
|
+
s.date = %q{2010-07-02}
|
10
10
|
s.description = %q{Deploy artifacts in a cloud environment.}
|
11
11
|
s.email = %q{jon@jbrisbin.com}
|
12
12
|
s.executables = ["deploy", "monitor"]
|
13
13
|
s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README.markdown", "bin/deploy", "bin/monitor", "lib/cloud/deploy.rb", "lib/cloud/deploy/artifact.rb", "lib/cloud/deploy/monitor.rb", "lib/cloud/logger.rb"]
|
14
|
-
s.files = ["CHANGELOG", "LICENSE", "README.markdown", "Rakefile", "bin/deploy", "bin/monitor", "cloud-utils.tmproj", "etc/deploy.yml", "etc/monitor.yml", "lib/cloud/deploy.rb", "lib/cloud/deploy/artifact.rb", "lib/cloud/deploy/monitor.rb", "lib/cloud/logger.rb", "
|
14
|
+
s.files = ["CHANGELOG", "LICENSE", "Manifest", "README.markdown", "Rakefile", "bin/deploy", "bin/monitor", "cloud-utils.tmproj", "etc/deploy.yml", "etc/monitor.yml", "lib/cloud/deploy.rb", "lib/cloud/deploy/artifact.rb", "lib/cloud/deploy/monitor.rb", "lib/cloud/logger.rb", "cloud-utils.gemspec"]
|
15
15
|
s.homepage = %q{http://github.com/jbrisbin/cloud-utils-deployer}
|
16
16
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Cloud-utils", "--main", "README.markdown"]
|
17
17
|
s.require_paths = ["lib"]
|
data/cloud-utils.tmproj
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
<plist version="1.0">
|
4
4
|
<dict>
|
5
5
|
<key>currentDocument</key>
|
6
|
-
<string>
|
6
|
+
<string>CHANGELOG</string>
|
7
7
|
<key>documents</key>
|
8
8
|
<array>
|
9
9
|
<dict>
|
@@ -21,14 +21,186 @@
|
|
21
21
|
<integer>260</integer>
|
22
22
|
<key>metaData</key>
|
23
23
|
<dict>
|
24
|
+
<key>CHANGELOG</key>
|
25
|
+
<dict>
|
26
|
+
<key>caret</key>
|
27
|
+
<dict>
|
28
|
+
<key>column</key>
|
29
|
+
<integer>22</integer>
|
30
|
+
<key>line</key>
|
31
|
+
<integer>0</integer>
|
32
|
+
</dict>
|
33
|
+
<key>firstVisibleColumn</key>
|
34
|
+
<integer>0</integer>
|
35
|
+
<key>firstVisibleLine</key>
|
36
|
+
<integer>0</integer>
|
37
|
+
</dict>
|
38
|
+
<key>README.markdown</key>
|
39
|
+
<dict>
|
40
|
+
<key>caret</key>
|
41
|
+
<dict>
|
42
|
+
<key>column</key>
|
43
|
+
<integer>54</integer>
|
44
|
+
<key>line</key>
|
45
|
+
<integer>52</integer>
|
46
|
+
</dict>
|
47
|
+
<key>firstVisibleColumn</key>
|
48
|
+
<integer>0</integer>
|
49
|
+
<key>firstVisibleLine</key>
|
50
|
+
<integer>5</integer>
|
51
|
+
</dict>
|
52
|
+
<key>Rakefile</key>
|
53
|
+
<dict>
|
54
|
+
<key>caret</key>
|
55
|
+
<dict>
|
56
|
+
<key>column</key>
|
57
|
+
<integer>22</integer>
|
58
|
+
<key>line</key>
|
59
|
+
<integer>2</integer>
|
60
|
+
</dict>
|
61
|
+
<key>firstVisibleColumn</key>
|
62
|
+
<integer>0</integer>
|
63
|
+
<key>firstVisibleLine</key>
|
64
|
+
<integer>0</integer>
|
65
|
+
</dict>
|
66
|
+
<key>bin/deploy</key>
|
67
|
+
<dict>
|
68
|
+
<key>caret</key>
|
69
|
+
<dict>
|
70
|
+
<key>column</key>
|
71
|
+
<integer>41</integer>
|
72
|
+
<key>line</key>
|
73
|
+
<integer>20</integer>
|
74
|
+
</dict>
|
75
|
+
<key>firstVisibleColumn</key>
|
76
|
+
<integer>0</integer>
|
77
|
+
<key>firstVisibleLine</key>
|
78
|
+
<integer>0</integer>
|
79
|
+
</dict>
|
80
|
+
<key>bin/monitor</key>
|
81
|
+
<dict>
|
82
|
+
<key>caret</key>
|
83
|
+
<dict>
|
84
|
+
<key>column</key>
|
85
|
+
<integer>44</integer>
|
86
|
+
<key>line</key>
|
87
|
+
<integer>55</integer>
|
88
|
+
</dict>
|
89
|
+
<key>firstVisibleColumn</key>
|
90
|
+
<integer>0</integer>
|
91
|
+
<key>firstVisibleLine</key>
|
92
|
+
<integer>14</integer>
|
93
|
+
</dict>
|
94
|
+
<key>etc/deploy.yml</key>
|
95
|
+
<dict>
|
96
|
+
<key>caret</key>
|
97
|
+
<dict>
|
98
|
+
<key>column</key>
|
99
|
+
<integer>0</integer>
|
100
|
+
<key>line</key>
|
101
|
+
<integer>12</integer>
|
102
|
+
</dict>
|
103
|
+
<key>firstVisibleColumn</key>
|
104
|
+
<integer>0</integer>
|
105
|
+
<key>firstVisibleLine</key>
|
106
|
+
<integer>0</integer>
|
107
|
+
</dict>
|
108
|
+
<key>etc/monitor.yml</key>
|
109
|
+
<dict>
|
110
|
+
<key>caret</key>
|
111
|
+
<dict>
|
112
|
+
<key>column</key>
|
113
|
+
<integer>23</integer>
|
114
|
+
<key>line</key>
|
115
|
+
<integer>9</integer>
|
116
|
+
</dict>
|
117
|
+
<key>columnSelection</key>
|
118
|
+
<false/>
|
119
|
+
<key>firstVisibleColumn</key>
|
120
|
+
<integer>0</integer>
|
121
|
+
<key>firstVisibleLine</key>
|
122
|
+
<integer>0</integer>
|
123
|
+
<key>selectFrom</key>
|
124
|
+
<dict>
|
125
|
+
<key>column</key>
|
126
|
+
<integer>0</integer>
|
127
|
+
<key>line</key>
|
128
|
+
<integer>8</integer>
|
129
|
+
</dict>
|
130
|
+
<key>selectTo</key>
|
131
|
+
<dict>
|
132
|
+
<key>column</key>
|
133
|
+
<integer>23</integer>
|
134
|
+
<key>line</key>
|
135
|
+
<integer>9</integer>
|
136
|
+
</dict>
|
137
|
+
</dict>
|
138
|
+
<key>lib/cloud/deploy.rb</key>
|
139
|
+
<dict>
|
140
|
+
<key>caret</key>
|
141
|
+
<dict>
|
142
|
+
<key>column</key>
|
143
|
+
<integer>1</integer>
|
144
|
+
<key>line</key>
|
145
|
+
<integer>14</integer>
|
146
|
+
</dict>
|
147
|
+
<key>columnSelection</key>
|
148
|
+
<false/>
|
149
|
+
<key>firstVisibleColumn</key>
|
150
|
+
<integer>0</integer>
|
151
|
+
<key>firstVisibleLine</key>
|
152
|
+
<integer>0</integer>
|
153
|
+
<key>selectFrom</key>
|
154
|
+
<dict>
|
155
|
+
<key>column</key>
|
156
|
+
<integer>0</integer>
|
157
|
+
<key>line</key>
|
158
|
+
<integer>0</integer>
|
159
|
+
</dict>
|
160
|
+
<key>selectTo</key>
|
161
|
+
<dict>
|
162
|
+
<key>column</key>
|
163
|
+
<integer>1</integer>
|
164
|
+
<key>line</key>
|
165
|
+
<integer>14</integer>
|
166
|
+
</dict>
|
167
|
+
</dict>
|
24
168
|
<key>lib/cloud/deploy/artifact.rb</key>
|
25
169
|
<dict>
|
26
170
|
<key>caret</key>
|
27
171
|
<dict>
|
28
172
|
<key>column</key>
|
29
|
-
<integer>
|
173
|
+
<integer>15</integer>
|
174
|
+
<key>line</key>
|
175
|
+
<integer>23</integer>
|
176
|
+
</dict>
|
177
|
+
<key>firstVisibleColumn</key>
|
178
|
+
<integer>0</integer>
|
179
|
+
<key>firstVisibleLine</key>
|
180
|
+
<integer>0</integer>
|
181
|
+
</dict>
|
182
|
+
<key>lib/cloud/deploy/monitor.rb</key>
|
183
|
+
<dict>
|
184
|
+
<key>caret</key>
|
185
|
+
<dict>
|
186
|
+
<key>column</key>
|
187
|
+
<integer>0</integer>
|
188
|
+
<key>line</key>
|
189
|
+
<integer>15</integer>
|
190
|
+
</dict>
|
191
|
+
<key>firstVisibleColumn</key>
|
192
|
+
<integer>0</integer>
|
193
|
+
<key>firstVisibleLine</key>
|
194
|
+
<integer>2</integer>
|
195
|
+
</dict>
|
196
|
+
<key>lib/cloud/logger.rb</key>
|
197
|
+
<dict>
|
198
|
+
<key>caret</key>
|
199
|
+
<dict>
|
200
|
+
<key>column</key>
|
201
|
+
<integer>0</integer>
|
30
202
|
<key>line</key>
|
31
|
-
<integer>
|
203
|
+
<integer>15</integer>
|
32
204
|
</dict>
|
33
205
|
<key>firstVisibleColumn</key>
|
34
206
|
<integer>0</integer>
|
@@ -39,6 +211,16 @@
|
|
39
211
|
<key>openDocuments</key>
|
40
212
|
<array>
|
41
213
|
<string>lib/cloud/deploy/artifact.rb</string>
|
214
|
+
<string>bin/deploy</string>
|
215
|
+
<string>bin/monitor</string>
|
216
|
+
<string>Rakefile</string>
|
217
|
+
<string>CHANGELOG</string>
|
218
|
+
<string>README.markdown</string>
|
219
|
+
<string>lib/cloud/deploy/monitor.rb</string>
|
220
|
+
<string>lib/cloud/deploy.rb</string>
|
221
|
+
<string>etc/monitor.yml</string>
|
222
|
+
<string>etc/deploy.yml</string>
|
223
|
+
<string>lib/cloud/logger.rb</string>
|
42
224
|
</array>
|
43
225
|
<key>showFileHierarchyDrawer</key>
|
44
226
|
<true/>
|
data/etc/monitor.yml
CHANGED
data/lib/cloud/deploy/monitor.rb
CHANGED
@@ -45,8 +45,9 @@ module Cloud
|
|
45
45
|
$log.info(@name) { "Connecting to MQ h: #{host}, p: #{port}, u: #{user}, pw: #{pass}, v: #{vhost}, x: #{exchange}" }
|
46
46
|
|
47
47
|
AMQP.start(:host => host, :port => port, :user => user, :pass => pass, :vhost => vhost) do
|
48
|
-
MQ.queue(@name).bind(@exchange).subscribe(:ack => true) do |headers, body|
|
48
|
+
MQ.queue(@name, :durable => true, :auto_delete => false).bind(@exchange, :type => "topic", :durable => true).subscribe(:ack => true) do |headers, body|
|
49
49
|
@md5sum = headers.properties[:correlation_id]
|
50
|
+
$log.debug('monitor') { "MD5 sum: #{@md5sum}" }
|
50
51
|
@artifact = body
|
51
52
|
end
|
52
53
|
end
|
metadata
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloud-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: "1.
|
8
|
+
- 1
|
9
|
+
version: "1.1"
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- J. Brisbin
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-07-02 00:00:00 -05:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -53,6 +53,7 @@ extra_rdoc_files:
|
|
53
53
|
files:
|
54
54
|
- CHANGELOG
|
55
55
|
- LICENSE
|
56
|
+
- Manifest
|
56
57
|
- README.markdown
|
57
58
|
- Rakefile
|
58
59
|
- bin/deploy
|
@@ -64,7 +65,6 @@ files:
|
|
64
65
|
- lib/cloud/deploy/artifact.rb
|
65
66
|
- lib/cloud/deploy/monitor.rb
|
66
67
|
- lib/cloud/logger.rb
|
67
|
-
- Manifest
|
68
68
|
- cloud-utils.gemspec
|
69
69
|
has_rdoc: true
|
70
70
|
homepage: http://github.com/jbrisbin/cloud-utils-deployer
|