kitchen_hooks 1.7.19 → 1.7.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/etc/commit-cookbook.json +17 -0
- data/etc/config.json +1 -2
- data/lib/kitchen_hooks/app.rb +2 -7
- data/lib/kitchen_hooks/helpers.rb +26 -9
- data/lib/kitchen_hooks/helpers/sync_servers.rb +14 -11
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fac70dd576d36fc397b807e4f26b0285213308aa
|
4
|
+
data.tar.gz: 11ac93017b9d37f78932895c592c96c1d43e23d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5acb685a916dccac38f28cd80033a6165b0bdaeb53815f0aa11783083df7b6b94e7cf638d7130e79156c2271d3e44b28919b3c868c62b0e47c4f062452baa38c
|
7
|
+
data.tar.gz: 2f20573519ee2a9e05116809c15b2c3949e27a341ce7ff653806a48a27efd592d77d2842d5e165330389183191fcc7f29c3a1669f49d1c0dc591f00dba1cc595
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.7.
|
1
|
+
1.7.20
|
@@ -0,0 +1,17 @@
|
|
1
|
+
{
|
2
|
+
"before": "0000000000000000000000000000000000000000",
|
3
|
+
"after": "34c97335f185916293d5cd3fc41fb5fc0b9535d1",
|
4
|
+
"ref": "refs/tags/v0.2.13",
|
5
|
+
"user_id": 645,
|
6
|
+
"user_name": "Sean Clemmer",
|
7
|
+
"repository": {
|
8
|
+
"name": "app_graphite",
|
9
|
+
"url": "git@git.bluejeansnet.com:chef/app_graphite.git",
|
10
|
+
"description": "",
|
11
|
+
"homepage": "http://git.bluejeansnet.com/chef/app_graphite"
|
12
|
+
},
|
13
|
+
"commits": [
|
14
|
+
|
15
|
+
],
|
16
|
+
"total_commits_count": 0
|
17
|
+
}
|
data/etc/config.json
CHANGED
data/lib/kitchen_hooks/app.rb
CHANGED
@@ -166,15 +166,10 @@ module KitchenHooks
|
|
166
166
|
|
167
167
|
|
168
168
|
def self.process_sync
|
169
|
-
|
170
|
-
|
171
|
-
sync_servers = SyncServers.new knives, cached_nodes
|
172
|
-
db.lock do
|
173
|
-
db.set! 'meta_cached_nodes', sync_servers.cached_nodes
|
174
|
-
end
|
169
|
+
db!
|
170
|
+
sync_servers = SyncServers.new knives
|
175
171
|
sync = sync_servers.status
|
176
172
|
puts 'Sync completed'
|
177
|
-
db!
|
178
173
|
sync_tag = sync[:num_failures].zero? ? 'synced' : 'unsynced'
|
179
174
|
mark sync, sync_tag
|
180
175
|
db!
|
@@ -119,7 +119,11 @@ module KitchenHooks
|
|
119
119
|
|
120
120
|
Dir.chdir clone do
|
121
121
|
$stdout.puts 'Uploading cookbook'
|
122
|
-
|
122
|
+
begin
|
123
|
+
outs = with_each_knife_do "cookbook upload #{cookbook_name event} -o .. --freeze", knives
|
124
|
+
rescue
|
125
|
+
raise 'Knife exited unsuccessfully. Perhaps the cookbook is frozen'
|
126
|
+
end
|
123
127
|
|
124
128
|
$stdout.puts 'Uploading bundled roles, environments, and data bags'
|
125
129
|
kitchen_upload knives
|
@@ -135,19 +139,31 @@ module KitchenHooks
|
|
135
139
|
def self.kitchen_upload knives
|
136
140
|
if Dir.exist? 'data_bags'
|
137
141
|
$stdout.puts 'Uploading data_bags'
|
138
|
-
|
142
|
+
begin
|
143
|
+
with_each_knife_do 'upload data_bags --chef-repo-path .', knives
|
144
|
+
rescue
|
145
|
+
raise 'Could not upload data bags'
|
146
|
+
end
|
139
147
|
end
|
140
148
|
|
141
149
|
if Dir.exist? 'roles'
|
142
150
|
$stdout.puts 'Uploading roles'
|
143
|
-
|
151
|
+
begin
|
152
|
+
with_each_knife_do 'upload roles --chef-repo-path .', knives
|
153
|
+
rescue
|
154
|
+
raise 'Could not upload roles'
|
155
|
+
end
|
144
156
|
end
|
145
157
|
|
146
158
|
if Dir.exist? 'environments'
|
147
159
|
$stdout.puts 'Uploading environments'
|
148
160
|
Dir['environments/*'].peach do |e|
|
149
161
|
knives.peach do |k|
|
150
|
-
|
162
|
+
begin
|
163
|
+
upload_environment e, k
|
164
|
+
rescue
|
165
|
+
raise 'Could not upload environments'
|
166
|
+
end
|
151
167
|
end
|
152
168
|
end
|
153
169
|
end
|
@@ -184,7 +200,7 @@ module KitchenHooks
|
|
184
200
|
'--config %s' % Shellwords::escape(berkshelf_config knife)
|
185
201
|
end
|
186
202
|
|
187
|
-
cmd =
|
203
|
+
cmd = 'bundle exec berks install --debug --berksfile %s %s' % [
|
188
204
|
Shellwords::escape(berksfile), knife_args
|
189
205
|
]
|
190
206
|
begin
|
@@ -209,7 +225,7 @@ module KitchenHooks
|
|
209
225
|
]
|
210
226
|
config_path = berkshelf_config(knife)
|
211
227
|
|
212
|
-
cmd =
|
228
|
+
cmd = 'bundle exec berks upload --debug --berksfile %s --config %s' % [
|
213
229
|
Shellwords::escape(berksfile), Shellwords::escape(config_path)
|
214
230
|
]
|
215
231
|
|
@@ -255,15 +271,16 @@ module KitchenHooks
|
|
255
271
|
|
256
272
|
|
257
273
|
def self.with_each_knife_do command, knives
|
258
|
-
with_each_knife "knife #{command} --config %{knife}", knives
|
274
|
+
with_each_knife "bundle exec knife #{command} --config %{knife}", knives
|
259
275
|
end
|
260
276
|
|
261
277
|
def self.with_each_knife command, knives
|
262
278
|
knives.pmap do |k|
|
263
279
|
cmd = command % { knife: Shellwords::escape(k) }
|
264
280
|
$stdout.puts 'with_each_knife: %s' % cmd
|
265
|
-
system cmd
|
266
|
-
|
281
|
+
out = system cmd
|
282
|
+
raise out unless $?.exitstatus.zero?
|
283
|
+
out
|
267
284
|
end
|
268
285
|
end
|
269
286
|
|
@@ -110,19 +110,22 @@ private
|
|
110
110
|
successes << n.name
|
111
111
|
end
|
112
112
|
|
113
|
-
|
114
|
-
|
113
|
+
# Don't delete node objects, but do remove them from the cache
|
115
114
|
deleted.each do |n|
|
116
|
-
|
117
|
-
ridleys.peach(4) do |ridley|
|
118
|
-
begin
|
119
|
-
ridley.node.delete n
|
120
|
-
@cached_nodes.delete n
|
121
|
-
rescue \
|
122
|
-
puts('WARNING: Could not delete node "%s"' % n)
|
123
|
-
end
|
124
|
-
end
|
115
|
+
@cached_nodes.delete n.name
|
125
116
|
end
|
117
|
+
deleted = []
|
118
|
+
# deleted.each do |n|
|
119
|
+
# puts 'Deleting node "%s"' % n
|
120
|
+
# ridleys.peach(4) do |ridley|
|
121
|
+
# begin
|
122
|
+
# ridley.node.delete n
|
123
|
+
# @cached_nodes.delete n
|
124
|
+
# rescue \
|
125
|
+
# puts('WARNING: Could not delete node "%s"' % n)
|
126
|
+
# end
|
127
|
+
# end
|
128
|
+
# end
|
126
129
|
|
127
130
|
return {
|
128
131
|
deleted: deleted,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen_hooks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Clemmer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hipchat
|
@@ -193,6 +193,7 @@ files:
|
|
193
193
|
- VERSION
|
194
194
|
- bin/kitchen_hooks
|
195
195
|
- etc/commit-constraint.json
|
196
|
+
- etc/commit-cookbook.json
|
196
197
|
- etc/commit-release.json
|
197
198
|
- etc/config.json
|
198
199
|
- kitchen_hooks.gemspec
|