kitchen-habitat 0.4.0 → 0.5.0

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: 321ed54954981ce9bcfa0d31cced155b68812dc7
4
- data.tar.gz: a38cb707e5ad064a4fc0a10bb61e3dc8cc935fb1
3
+ metadata.gz: 8202421b33f9f01b1cf7a61ecb7000e8a76ff1ea
4
+ data.tar.gz: 15d2665a88e8692ab55c26e449c286949159c069
5
5
  SHA512:
6
- metadata.gz: 4828aca661dfecceb7d5621a208380e10829d40b6dd642ba30ca91353b25f7ad4919c20221dfdc6e58a6d74a5f633409ecfdef41f6e6963ae69f1f7e909d8c19
7
- data.tar.gz: ec60a9cef994028c90a27b97541eeea8d8633d43b1914d7b1939f76b1e1410f711a41586431b62fc27fc773af4c920a18c0e6097dee6f4706878b956b2e1beb7
6
+ metadata.gz: 2862f2e9904b5cd170657489cf334fe8ba5f7a54e35739524400bc2ded4cc3fa62d8c4e6184a16a0cf850cac3df0ed9810b8aad80262eb456b1a184e08c11173
7
+ data.tar.gz: 8d83f00b86b1289fc20077ee835f99fdd57e73ca16a6c9a1f614001d9b93f426b85d53bf9e5b28c09d98011c235b342941a3f1e6c6ce57c5d7b4ac086da7b65c
data/README.md CHANGED
@@ -66,7 +66,7 @@ You'll need the test-kitchen & kitchen-habitat gems installed in your system, al
66
66
  * `package_version`
67
67
  * Package version of the package to be run.
68
68
  * Defaults to `nil` or if `artifact_name` is supplied, the `package_version` will be parsed from the filename of the hart file.
69
- * `package_releae`
69
+ * `package_release`
70
70
  * Package release of the package to be run.
71
71
  * Defaults to `nil` or if `artifact_name` is supplied, the `package_release` will be parsed from the filename of the hart file.
72
72
  * `service_topology`
@@ -88,11 +88,18 @@ You'll need the test-kitchen & kitchen-habitat gems installed in your system, al
88
88
  ## Example
89
89
 
90
90
  ```yaml
91
+ driver:
92
+ name: vagrant
93
+
91
94
  provisioner:
92
- - name: habitat
93
- hab_sup: core/hab/0.16.0
94
-
95
+ name: habitat
96
+ hab_sup: core/hab/0.16.0
97
+ package_origin: core
98
+ package_name: redis
99
+
100
+ platforms:
101
+ - name: ubuntu-16.04
95
102
 
96
- suite:
97
- - name: core/redis
103
+ suites:
104
+ - name: default
98
105
  ```
@@ -1,5 +1,5 @@
1
1
  module Kitchen
2
2
  module Habitat
3
- VERSION = "0.4.0".freeze
3
+ VERSION = "0.5.0".freeze
4
4
  end
5
5
  end
@@ -51,6 +51,12 @@ module Kitchen
51
51
  default_config :use_screen, false
52
52
 
53
53
  def finalize_config!(instance)
54
+
55
+ # Check to see if a package ident was specified for package name and be helpful
56
+ unless (config[:package_name] =~ /\//).nil?
57
+ config[:package_origin], config[:package_name], config[:package_version], config[:package_release] = config[:package_name].split('/')
58
+ end
59
+
54
60
  unless config[:hab_sup_artifact_name].nil?
55
61
  ident = artifact_name_to_package_ident_regex.match(config[:hab_sup_artifact_name])
56
62
  config[:hab_sup_origin] = ident["origin"]
@@ -70,23 +76,20 @@ module Kitchen
70
76
  end
71
77
 
72
78
  def install_command
73
- if instance.platform == "windows"
74
- raise "Need to fill in some implementation here."
79
+ raise 'Need to fill in some implementation here.' if instance.platform == 'windows'
80
+ wrap_shell_code <<-BASH
81
+ #{export_hab_origin}
82
+ if command -v hab >/dev/null 2>&1
83
+ then
84
+ echo "Habitat CLI already installed."
75
85
  else
76
- wrap_shell_code <<-BASH
77
- #{export_hab_origin}
78
- if command -v hab >/dev/null 2>&1
79
- then
80
- echo "Habitat CLI already installed."
81
- else
82
- curl 'https://raw.githubusercontent.com/habitat-sh/habitat/master/components/hab/install.sh' | sudo bash
83
- fi
84
- BASH
85
- end
86
+ curl 'https://raw.githubusercontent.com/habitat-sh/habitat/master/components/hab/install.sh' | sudo bash
87
+ fi
88
+ BASH
86
89
  end
87
90
 
88
91
  def init_command
89
- wrap_shell_code "id -u hab >/dev/null 2>&1 || sudo useradd hab >/dev/null 2>&1"
92
+ wrap_shell_code 'id -u hab >/dev/null 2>&1 || sudo useradd hab >/dev/null 2>&1'
90
93
  end
91
94
 
92
95
  def create_sandbox
@@ -190,7 +193,7 @@ module Kitchen
190
193
  def copy_user_toml_to_sandbox
191
194
  return if config[:config_directory].nil?
192
195
  FileUtils.mkdir_p(File.join(sandbox_path, "config"))
193
- FileUtils.cp_r(File.join(config[:kitchen_root], config[:config_directory]), File.join(sandbox_path, "config"))
196
+ FileUtils.cp(full_user_toml_path, File.join(sandbox_path, "config/user.toml"))
194
197
  end
195
198
 
196
199
  def install_service_package
@@ -200,7 +203,10 @@ module Kitchen
200
203
 
201
204
  def copy_user_toml_to_service_directory
202
205
  return unless !config[:config_directory].nil? && File.exist?(full_user_toml_path)
203
- "cp #{File.join(File.join(config[:root_path], 'config'), 'user.toml')} /hab/svc/#{config[:package_name]}/"
206
+ <<-EOH
207
+ sudo mkdir -p /hab/svc/#{config[:package_name]}
208
+ sudo cp #{File.join(File.join(config[:root_path], 'config'), 'user.toml')} /hab/svc/#{config[:package_name]}/user.toml
209
+ EOH
204
210
  end
205
211
 
206
212
  def remove_previous_user_toml
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-habitat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Murawski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-06 00:00:00.000000000 Z
11
+ date: 2017-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen