service_kiosk 0.5.2 → 0.5.3
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.
- data/bin/kiosk +12 -9
- metadata +1 -1
data/bin/kiosk
CHANGED
@@ -12,33 +12,36 @@ def config
|
|
12
12
|
JSON.parse file
|
13
13
|
end
|
14
14
|
|
15
|
+
def vagrant_exec(command)
|
16
|
+
exec "env KIOSK_GEM_DIR=#{gem_dir} #{command}"
|
17
|
+
end
|
18
|
+
|
15
19
|
case ARGV[0]
|
16
20
|
when 'plaza:init', 'init'
|
17
|
-
boxes = `vagrant box list`
|
21
|
+
boxes = `env KIOSK_GEM_DIR=#{gem_dir} vagrant box list`
|
18
22
|
if(/precise32/m.match boxes)
|
19
23
|
puts 'plaza already initialized'
|
20
24
|
else
|
21
|
-
|
25
|
+
vagrant_exec 'vagrant init precise32 http://files.vagrantup.com/precise32.box'
|
22
26
|
end
|
23
27
|
|
24
28
|
when 'plaza:up', 'up'
|
25
|
-
|
26
|
-
system "env KIOSK_GEM_DIR=#{gem_dir} vagrant up"
|
29
|
+
vagrant_exec "vagrant up"
|
27
30
|
|
28
31
|
when 'plaza:down', 'down'
|
29
|
-
|
32
|
+
vagrant_exec "vagrant destroy"
|
30
33
|
|
31
34
|
when 'plaza:ssh', 'ssh'
|
32
|
-
|
35
|
+
vagrant_exec 'vagrant ssh'
|
33
36
|
|
34
37
|
when 'mall:open', 'open'
|
35
|
-
|
38
|
+
vagrant_exec "vagrant ssh -c 'cd /vagrant/mall; /usr/local/bin/rake kiosk:start'"
|
36
39
|
|
37
40
|
when 'mall:close', 'close'
|
38
|
-
|
41
|
+
vagrant_exec "vagrant ssh -c 'cd /vagrant/mall; /usr/local/bin/rake kiosk:stop'"
|
39
42
|
|
40
43
|
when 'mall:log', 'log'
|
41
|
-
|
44
|
+
vagrant_exec "vagrant ssh -c 'cd /vagrant/mall; /usr/local/bin/rake kiosk:log'"
|
42
45
|
|
43
46
|
when 'kiosk:run', 'run'
|
44
47
|
env = config['kiosks'][ARGV[1]]['env']
|