kitchen-habitat 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a53b0e7ecbcbd344079d5a0e3b57c6c1391724d34f4eea6676ad2dcda50551de
4
- data.tar.gz: 2fe775cc541a35c9434642e325e379772c40231c6bdce06c24874851cf5a7b19
3
+ metadata.gz: d2a1fb8ade246aa6d678e6ef4e459204465a1d905933f3497edbf5c4f42f37ce
4
+ data.tar.gz: 3d4026a94857b3f551ca4a41cea0061796a4149e6ae559187c61c5e7505bac2a
5
5
  SHA512:
6
- metadata.gz: a0788b1af617b81b2847b712c9500069eb8111b5443cb7a6af696fe1877eb00197f0719cb1cb9ccf81f086323c441f8f6c861b225c458cb15f2518f80c83da7f
7
- data.tar.gz: 61752d3d8b85cb1e72267c911d69f51c07d30a4e599bfcab179c358b689714ba2bd155963b24730427f34678f16b4e26172584aab028a2d0dcfeef16763c8d72
6
+ metadata.gz: 15d2703d84279215547ca903670e43b8ed31551bf5a3fce94f460743a92cfb603fae10560f0b09c576fca7e571d476558e429853affe2aa09ec58d0b7ff58d0e
7
+ data.tar.gz: 136cacef506411b56e4e8b9cb97c781f8cb7b9ccee4bb741322b0ce85184e332ec5de66db52f256c4580586967d5ad8a5261a760ee11d50515a4ca9443793c25
@@ -1,5 +1,5 @@
1
1
  module Kitchen
2
2
  module Habitat
3
- VERSION = "0.10.0".freeze
3
+ VERSION = "0.11.0".freeze
4
4
  end
5
5
  end
@@ -17,6 +17,7 @@ module Kitchen
17
17
  kitchen_provisioner_api_version 2
18
18
 
19
19
  default_config :depot_url, nil
20
+ default_config :hab_version, "latest"
20
21
  default_config :hab_sup_origin, "core"
21
22
  default_config :hab_sup_name, "hab-sup"
22
23
  default_config :hab_sup_version, nil
@@ -78,13 +79,17 @@ module Kitchen
78
79
 
79
80
  def install_command
80
81
  raise "Need to fill in some implementation here." if instance.platform == "windows"
82
+
83
+ version = " -v #{config[:hab_version]}" unless config[:hab_version].eql?("latest")
84
+
81
85
  wrap_shell_code <<-BASH
82
86
  #{export_hab_bldr_url}
83
87
  if command -v hab >/dev/null 2>&1
84
88
  then
85
89
  echo "Habitat CLI already installed."
86
90
  else
87
- curl 'https://raw.githubusercontent.com/habitat-sh/habitat/master/components/hab/install.sh' | sudo -E bash
91
+ curl -o /tmp/install.sh 'https://raw.githubusercontent.com/habitat-sh/habitat/master/components/hab/install.sh'
92
+ sudo -E bash /tmp/install.sh#{version}
88
93
  fi
89
94
  BASH
90
95
  end
@@ -154,6 +159,23 @@ module Kitchen
154
159
  EOH
155
160
  end
156
161
 
162
+ 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
177
+ end
178
+
157
179
  def run_package_in_background
158
180
  if config[:use_screen]
159
181
  "sudo -E screen -mdS \"#{clean_package_name}\" hab start #{package_ident} #{supervisor_options}"
@@ -161,7 +183,12 @@ module Kitchen
161
183
  <<-RUN
162
184
  [ -f ./run.pid ] && rm -f run.pid
163
185
  [ -f ./nohup.out ] && rm -f nohup.out
164
- nohup sudo -E hab sup run #{supervisor_options} & echo $! > run.pid
186
+
187
+ #{sup_run_script}
188
+
189
+ sudo -E chmod +x /tmp/sup-run.sh
190
+
191
+ nohup /tmp/sup-run.sh & > sup-run.out
165
192
 
166
193
  until sudo -E hab svc status
167
194
  do
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.10.0
4
+ version: 0.11.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: 2018-08-22 00:00:00.000000000 Z
11
+ date: 2018-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen