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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 90cf6269ccff702ef06f59870579a1aa1352281c
4
- data.tar.gz: c340a7e6d74b942edbf388681a6ece6b90d06de0
3
+ metadata.gz: fac70dd576d36fc397b807e4f26b0285213308aa
4
+ data.tar.gz: 11ac93017b9d37f78932895c592c96c1d43e23d5
5
5
  SHA512:
6
- metadata.gz: 821019eed8e3fd76fe6f4c34e100306cde5e51e332edf58d3ef777b798729db3aeef8ef3dd14df58eaf835475b7e23948f257635e6acf3e9fce636e1155025a7
7
- data.tar.gz: 97e4690b0424e8c7d3277c06fef0bffe06d790d15189d02d2fc196fe9e493ea0cce67d797b9c033385c2fe9b01be64825766eab75a1c0f01b7049f4b8102d0fc
6
+ metadata.gz: 5acb685a916dccac38f28cd80033a6165b0bdaeb53815f0aa11783083df7b6b94e7cf638d7130e79156c2271d3e44b28919b3c868c62b0e47c4f062452baa38c
7
+ data.tar.gz: 2f20573519ee2a9e05116809c15b2c3949e27a341ce7ff653806a48a27efd592d77d2842d5e165330389183191fcc7f29c3a1669f49d1c0dc591f00dba1cc595
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.7.19
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
@@ -1,8 +1,7 @@
1
1
  {
2
- "sync_interval": null,
2
+ "sync_interval": 60,
3
3
  "hipchat": null,
4
4
  "knives": {
5
- "sj1": "~/.chef/sj1.rb",
6
5
  "dc1": "~/.chef/dc1.rb",
7
6
  "bng11": "~/.chef/bng11.rb"
8
7
  }
@@ -166,15 +166,10 @@ module KitchenHooks
166
166
 
167
167
 
168
168
  def self.process_sync
169
- cached_nodes = db['meta_cached_nodes']
170
- cached_nodes ||= {}
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
- with_each_knife_do "cookbook upload #{cookbook_name event} -o .. --freeze", knives
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
- with_each_knife_do 'upload data_bags --chef-repo-path .', knives
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
- with_each_knife_do 'upload roles --chef-repo-path .', knives
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
- upload_environment e, k
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 = "berks install --debug --berksfile %s %s" % [
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 = "berks upload --debug --berksfile %s --config %s" % [
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
- # No error handling here; do that on "berks upload"
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
- deleted = [] # Don't delete node objects
114
-
113
+ # Don't delete node objects, but do remove them from the cache
115
114
  deleted.each do |n|
116
- puts 'Deleting node "%s"' % n
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.19
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-05-28 00:00:00.000000000 Z
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