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 +4 -4
- data/README.md +13 -6
- data/lib/kitchen-habitat/version.rb +1 -1
- data/lib/kitchen/provisioner/habitat.rb +21 -15
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8202421b33f9f01b1cf7a61ecb7000e8a76ff1ea
|
4
|
+
data.tar.gz: 15d2665a88e8692ab55c26e449c286949159c069
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
* `
|
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
|
-
|
93
|
-
|
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
|
-
|
97
|
-
- name:
|
103
|
+
suites:
|
104
|
+
- name: default
|
98
105
|
```
|
@@ -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 ==
|
74
|
-
|
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
|
-
|
77
|
-
|
78
|
-
|
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
|
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.
|
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
|
-
|
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
|
+
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-
|
11
|
+
date: 2017-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-kitchen
|