kitchen-habitat 0.11.0 → 0.11.1

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
  SHA256:
3
- metadata.gz: d2a1fb8ade246aa6d678e6ef4e459204465a1d905933f3497edbf5c4f42f37ce
4
- data.tar.gz: 3d4026a94857b3f551ca4a41cea0061796a4149e6ae559187c61c5e7505bac2a
3
+ metadata.gz: 829dec57fdb189dcd37c2d5ec649ab0d0efed8584f5e2c711f171b21610fc9ec
4
+ data.tar.gz: ca4c16b4dcd0d6bc49c98dd8f4f0b5d888aafc954cd143e9f9e992b9ed7d4622
5
5
  SHA512:
6
- metadata.gz: 15d2703d84279215547ca903670e43b8ed31551bf5a3fce94f460743a92cfb603fae10560f0b09c576fca7e571d476558e429853affe2aa09ec58d0b7ff58d0e
7
- data.tar.gz: 136cacef506411b56e4e8b9cb97c781f8cb7b9ccee4bb741322b0ce85184e332ec5de66db52f256c4580586967d5ad8a5261a760ee11d50515a4ca9443793c25
6
+ metadata.gz: a87b899607aa31a5a497b82310de421621f272a1c6e08c40d25afa6fba77cc420671d067024d9545fe6ecab5b469e43a5a72890a1001632a795b9871800ff35d
7
+ data.tar.gz: 41bbd702a57ee8ec7758f51bed075dd5e5060ff6aae46f9c8da361d77cb9231d92172756752fbd4948f11528839774bb43b7bcd6de44bb0fe9c5ff9160d15e32
@@ -1,5 +1,5 @@
1
1
  module Kitchen
2
2
  module Habitat
3
- VERSION = "0.11.0".freeze
3
+ VERSION = "0.11.1".freeze
4
4
  end
5
5
  end
@@ -55,7 +55,7 @@ module Kitchen
55
55
 
56
56
  def finalize_config!(instance)
57
57
  # Check to see if a package ident was specified for package name and be helpful
58
- unless config[:package_name].nil? || (config[:package_name] =~ /\//).nil?
58
+ unless config[:package_name].nil? || (config[:package_name] =~ %r{/}).nil?
59
59
  config[:package_origin], config[:package_name], config[:package_version], config[:package_release] = config[:package_name].split("/")
60
60
  end
61
61
 
@@ -99,7 +99,7 @@ module Kitchen
99
99
  id -u hab >/dev/null 2>&1 || sudo -E useradd hab >/dev/null 2>&1
100
100
  rm -rf /tmp/kitchen
101
101
  mkdir -p /tmp/kitchen/results
102
- #{'mkdir -p /tmp/kitchen/config' unless config[:override_package_config]}
102
+ #{"mkdir -p /tmp/kitchen/config" unless config[:override_package_config]}
103
103
  EOH
104
104
  end
105
105
 
@@ -118,7 +118,7 @@ module Kitchen
118
118
  #{install_service_package}
119
119
  #{remove_previous_user_toml}
120
120
  #{copy_user_toml_to_service_directory}
121
- EOH
121
+ EOH
122
122
  end
123
123
 
124
124
  def run_command
@@ -137,6 +137,7 @@ module Kitchen
137
137
 
138
138
  def clean_up_screen_sessions
139
139
  return unless config[:use_screen]
140
+
140
141
  <<-CLEAN
141
142
  if sudo -E screen -ls | grep -q #{clean_package_name}
142
143
  then
@@ -150,6 +151,7 @@ module Kitchen
150
151
 
151
152
  def clean_up_previous_supervisor
152
153
  return if config[:use_screen]
154
+
153
155
  <<-EOH
154
156
  [ -f ./run.pid ] && echo "Removing previous supervisor and unloading package. "
155
157
  [ -f ./run.pid ] && sudo -E hab svc unload #{package_ident}
@@ -160,20 +162,20 @@ module Kitchen
160
162
  end
161
163
 
162
164
  def sup_run_script
163
- <<-SCRIPT
164
- cat > /tmp/sup-run.sh <<"END"
165
- #!/bin/bash
166
-
167
- while true
168
- do
169
- COUNT=$(ps aux | grep hab | wc -l)
170
- if [[ ${COUNT} -lt 2 ]]
171
- then
172
- sudo -E hab sup run #{supervisor_options} > ~/nohup.out & echo $! > /tmp/run.pid
173
- fi
174
- done
175
- END
176
- SCRIPT
165
+ <<~SCRIPT
166
+ cat > /tmp/sup-run.sh <<"END"
167
+ #!/bin/bash
168
+
169
+ while true
170
+ do
171
+ COUNT=$(ps aux | grep hab | wc -l)
172
+ if [[ ${COUNT} -lt 2 ]]
173
+ then
174
+ sudo -E hab sup run #{supervisor_options} > ~/nohup.out & echo $! > /tmp/run.pid
175
+ fi
176
+ done
177
+ END
178
+ SCRIPT
177
179
  end
178
180
 
179
181
  def run_package_in_background
@@ -226,6 +228,7 @@ SCRIPT
226
228
  def copy_package_config_from_override_to_sandbox
227
229
  return if config[:config_directory].nil?
228
230
  return unless config[:override_package_config]
231
+
229
232
  local_config_dir = File.join(config[:kitchen_root], config[:config_directory])
230
233
  return unless Dir.exist?(local_config_dir)
231
234
 
@@ -235,8 +238,10 @@ SCRIPT
235
238
 
236
239
  def copy_results_to_sandbox
237
240
  return if config[:artifact_name].nil? && !config[:install_latest_artifact]
241
+
238
242
  results_dir = resolve_results_directory
239
243
  return if results_dir.nil?
244
+
240
245
  FileUtils.mkdir_p(File.join(sandbox_path, "results"))
241
246
  FileUtils.cp(
242
247
  File.join(results_dir, config[:install_latest_artifact] ? latest_artifact_name : config[:artifact_name]),
@@ -256,6 +261,7 @@ SCRIPT
256
261
  def copy_user_toml_to_sandbox
257
262
  return if config[:config_directory].nil?
258
263
  return unless File.exist?(full_user_toml_path)
264
+
259
265
  FileUtils.mkdir_p(File.join(sandbox_path, "config"))
260
266
  debug("Copying user.toml from #{full_user_toml_path} to #{sandbox_user_toml_path}")
261
267
  FileUtils.cp(full_user_toml_path, sandbox_user_toml_path)
@@ -293,9 +299,10 @@ SCRIPT
293
299
 
294
300
  def copy_user_toml_to_service_directory
295
301
  return unless !config[:config_directory].nil? && File.exist?(full_user_toml_path)
302
+
296
303
  <<-EOH
297
304
  sudo -E mkdir -p /hab/svc/#{config[:package_name]}
298
- sudo -E cp #{File.join(File.join(config[:root_path], 'config'), 'user.toml')} /hab/svc/#{config[:package_name]}/user.toml
305
+ sudo -E cp #{File.join(File.join(config[:root_path], "config"), "user.toml")} /hab/svc/#{config[:package_name]}/user.toml
299
306
  EOH
300
307
  end
301
308
 
@@ -309,6 +316,7 @@ SCRIPT
309
316
 
310
317
  def export_hab_bldr_url
311
318
  return if config[:depot_url].nil?
319
+
312
320
  "export HAB_BLDR_URL=#{config[:depot_url]}"
313
321
  end
314
322
 
@@ -348,7 +356,7 @@ SCRIPT
348
356
  options = ""
349
357
  options += " --listen-ctl #{config[:hab_sup_listen_ctl]}" unless config[:hab_sup_listen_ctl].nil?
350
358
  options += " --listen-gossip #{config[:hab_sup_listen_gossip]}" unless config[:hab_sup_listen_gossip].nil?
351
- options += " --config-from #{File.join(config[:root_path], 'config/')}" if config[:override_package_config]
359
+ options += " --config-from #{File.join(config[:root_path], "config/")}" if config[:override_package_config]
352
360
  options += config[:hab_sup_bind].map { |b| " --bind #{b}" }.join(" ") if config[:hab_sup_bind].any?
353
361
  options += config[:hab_sup_peer].map { |p| " --peer #{p}" }.join(" ") if config[:hab_sup_peer].any?
354
362
  options += " --group #{config[:hab_sup_group]}" unless config[:hab_sup_group].nil?
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-habitat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Murawski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-28 00:00:00.000000000 Z
11
+ date: 2019-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.4'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '3'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: '1.4'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '3'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: countloc
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -110,12 +116,11 @@ extensions: []
110
116
  extra_rdoc_files: []
111
117
  files:
112
118
  - README.md
113
- - kitchen-habitat.gemspec
114
119
  - lib/kitchen-habitat/version.rb
115
120
  - lib/kitchen/provisioner/habitat.rb
116
121
  homepage: https://github.com/test-kitchen/kitchen-habitat
117
122
  licenses:
118
- - Apache 2
123
+ - Apache-2.0
119
124
  metadata: {}
120
125
  post_install_message:
121
126
  rdoc_options: []
@@ -132,8 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
137
  - !ruby/object:Gem::Version
133
138
  version: '0'
134
139
  requirements: []
135
- rubyforge_project: "[none]"
136
- rubygems_version: 2.7.6
140
+ rubygems_version: 3.0.3
137
141
  signing_key:
138
142
  specification_version: 4
139
143
  summary: Habitat provisioner for test-kitchen
@@ -1,38 +0,0 @@
1
- $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
2
- require "kitchen-habitat/version"
3
-
4
- Gem::Specification.new do |s|
5
- s.name = "kitchen-habitat"
6
- s.version = Kitchen::Habitat::VERSION
7
- s.authors = ["Steven Murawski"]
8
- s.email = ["smurawski@chef.io"]
9
- s.homepage = "https://github.com/test-kitchen/kitchen-habitat"
10
- s.summary = "Habitat provisioner for test-kitchen"
11
- candidates = Dir.glob("lib/**/*") + ["README.md", "kitchen-habitat.gemspec"]
12
- s.files = candidates.sort
13
- s.platform = Gem::Platform::RUBY
14
- s.require_paths = ["lib"]
15
- s.rubyforge_project = "[none]"
16
- s.license = "Apache 2"
17
- s.description = <<-EOF
18
- == DESCRIPTION:
19
-
20
- Habitat Provisioner for Test Kitchen
21
-
22
- == FEATURES:
23
-
24
- TBD
25
-
26
- EOF
27
- s.add_dependency "test-kitchen", "~> 1.4"
28
-
29
- s.add_development_dependency "countloc", "~> 0.4"
30
- s.add_development_dependency "rake"
31
- s.add_development_dependency "rspec", "~> 3.2"
32
- s.add_development_dependency "simplecov", "~> 0.9"
33
-
34
- # style and complexity libraries are tightly version pinned as newer releases
35
- # may introduce new and undesireable style choices which would be immediately
36
- # enforced in CI
37
- s.add_development_dependency "chefstyle"
38
- end