kitchen_hooks 1.7.13 → 1.7.14

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: 7547b532dfd1f1769211d8d0dfbaff80c9cc9ec4
4
- data.tar.gz: 11b5bd99de0c8b841daf1b4b41c3af944ebbe362
3
+ metadata.gz: d79c5b35992c0b702d82ca724450adf64d278543
4
+ data.tar.gz: ffd258c665a0e05c247c226131b3f86a55f7a16d
5
5
  SHA512:
6
- metadata.gz: 5bc83fafd03deb3f8ed2c583d8106544fde41061325d8f396d78cd214031d49cfd122275b68d10bc8d8b112a88410ae805a44aad0b8b6265c39cb58d171b9ce3
7
- data.tar.gz: 7f3773e3589c928837199b2b1e609eb65809e6a44705607e7e8be55e69032641bb0366a8683a7e4cafb5bae656c80efbc7b0638902ead4336774caaf30de7374
6
+ metadata.gz: 189e45821445f040498ccce4f56a1d604fa1f3cc8e738ba7c2a025974c27f5a5181901148b0cf9fc117ab24350e6db37b950b6bfb9fcc69ae6fe2c14352f580c
7
+ data.tar.gz: b5d4cf3c1e4a9651f566f14e21529873ae641d097ccac9621fcfe3f482b6572fc0a882b466913b329356d302b882fdbb63d3a0c662dfc72a316e6de8c9f37ae3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.7.13
1
+ 1.7.14
@@ -1,21 +1,21 @@
1
1
  {
2
- "before": "52398401e005ec9003e932571147366cdaa3ce4b",
3
- "after": "52398401e005ec9003e932571147366cdaa3ce4b",
4
- "ref": "refs/tags/v0.2.5",
2
+ "before": "fd4777414aeb61315d292936687d5a87e7d62ded",
3
+ "after": "fd4777414aeb61315d292936687d5a87e7d62ded",
4
+ "ref": "refs/tags/v0.2.6",
5
5
  "user_id": 645,
6
6
  "user_name": "Sean Clemmer",
7
7
  "repository": {
8
- "name": "app_cassandra_dse",
9
- "url": "git@git.bluejeansnet.com:chef/app_cassandra_dse.git",
8
+ "name": "app_graphite",
9
+ "url": "git@git.bluejeansnet.com:chef/app_graphite.git",
10
10
  "description": "",
11
- "homepage": "http://git.bluejeansnet.com/chef/app_cassandra_dse"
11
+ "homepage": "http://git.bluejeansnet.com/chef/app_graphite"
12
12
  },
13
13
  "commits": [
14
14
  {
15
- "id": "52398401e005ec9003e932571147366cdaa3ce4b",
15
+ "id": "fd4777414aeb61315d292936687d5a87e7d62ded",
16
16
  "message": "XYZ",
17
17
  "timestamp": "2014-11-25T18:30:57-08:00",
18
- "url": "http://git.bluejeansnet.com/chef/app_cassandra_dse/commit/bbdfcc13233ca0173c75896155c8013e08fa81e6",
18
+ "url": "http://git.bluejeansnet.com/chef/app_graphite/commit/fd4777414aeb61315d292936687d5a87e7d62ded",
19
19
  "author": {
20
20
  "name": "Sean Clemmer",
21
21
  "email": "sclemmer@bluejeans.com"
data/etc/config.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "sync_interval": 30,
2
+ "sync_interval": null,
3
3
  "hipchat": null,
4
4
  "knives": {
5
5
  "sj1": "~/.chef/sj1.rb",
@@ -46,6 +46,7 @@ module KitchenHooks
46
46
  end
47
47
 
48
48
  def self.sync!
49
+ return if @@sync_interval.nil?
49
50
  @@sync_worker = Thread.new do
50
51
  loop do
51
52
  process_sync
@@ -66,7 +67,7 @@ module KitchenHooks
66
67
  @@knives = config['knives'].map do |_, knife|
67
68
  Pathname.new(knife).expand_path.realpath.to_s
68
69
  end
69
- @@sync_interval = config.fetch 'sync_interval', 3600 # Hourly
70
+ @@sync_interval = config['sync_interval']
70
71
  end
71
72
 
72
73
  get '/backlog' do
@@ -107,8 +107,14 @@ module KitchenHooks
107
107
  end
108
108
 
109
109
  berksfile = File::join clone, 'Berksfile'
110
+ berksfile_lock = "#{berksfile}.lock"
111
+
112
+ # If no lockfile provided, use latest dependencies
113
+ do_update = !File::exist?(berksfile_lock)
114
+
110
115
  $stdout.puts 'Uploading dependencies'
111
116
  berks_install berksfile
117
+ berks_update berksfile if do_update
112
118
  knives.peach do |knife|
113
119
  berks_upload berksfile, knife
114
120
  end
@@ -164,6 +170,30 @@ module KitchenHooks
164
170
  end
165
171
 
166
172
 
173
+ def self.berks_update berksfile
174
+ $stdout.puts 'started berks_update berksfile=%s' % berksfile.inspect
175
+ env_git_dir = ENV.delete 'GIT_DIR'
176
+ env_git_work_tree = ENV.delete 'GIT_WORK_TREE'
177
+
178
+ cmd = "berks update --debug --berksfile %s" % [
179
+ Shellwords::escape(berksfile)
180
+ ]
181
+ begin
182
+ $stdout.puts "berks_update: %s" % cmd
183
+ system cmd
184
+ raise unless $?.exitstatus.zero?
185
+ rescue
186
+ raise 'Could not perform berks_update with config %s' % [
187
+ berksfile.inspect
188
+ ]
189
+ end
190
+
191
+ ENV['GIT_DIR'] = env_git_dir
192
+ ENV['GIT_WORK_TREE'] = env_git_work_tree
193
+ $stdout.puts 'finished berks_update: %s' % berksfile
194
+ end
195
+
196
+
167
197
  def self.berks_install berksfile
168
198
  $stdout.puts 'started berks_install berksfile=%s' % berksfile.inspect
169
199
  env_git_dir = ENV.delete 'GIT_DIR'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen_hooks
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.13
4
+ version: 1.7.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Clemmer