nise-bosh-vagrant 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -54,10 +54,16 @@ EOS
|
|
54
54
|
|
55
55
|
# If instructed, install the release
|
56
56
|
if opts[:install]
|
57
|
-
|
57
|
+
if opts[:preinstall]
|
58
|
+
puts "---> Running preinstall script"
|
59
|
+
runner.run_preinstall_release
|
60
|
+
end
|
58
61
|
puts "---> Installing release"
|
59
62
|
runner.install_release
|
60
|
-
|
63
|
+
if opts[:postinstall]
|
64
|
+
puts "---> Running postinstall script"
|
65
|
+
runner.run_postinstall_release
|
66
|
+
end
|
61
67
|
end
|
62
68
|
|
63
69
|
# If instructed, start the release
|
@@ -10,7 +10,7 @@ module NiseBOSHVagrant
|
|
10
10
|
:copy_name, :memory
|
11
11
|
|
12
12
|
def initialize(opts)
|
13
|
-
opts[:nise].nil? ? @nise_path = nil : @nise_path = opts[:nise]
|
13
|
+
opts[:nise].nil? ? @nise_path = nil : @nise_path = File.expand_path(opts[:nise])
|
14
14
|
@release_path = opts[:release]
|
15
15
|
@vagrantfile_path = File.join(@release_path, "Vagrantfile")
|
16
16
|
@scripts_path = File.join(File.dirname(File.expand_path(__FILE__)), "../../scripts")
|
@@ -43,13 +43,17 @@ module NiseBOSHVagrant
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def copy_hook_scripts(output_dir=@release_path, preinstall_file=@preinstall_file, postinstall_file=@postinstall_file)
|
46
|
+
@preinstall_copy_path = File.join(output_dir, @copy_name[:preinstall])
|
46
47
|
if preinstall_file
|
47
|
-
@preinstall_copy_path = File.join(output_dir, @copy_name[:preinstall])
|
48
48
|
FileUtils.cp(preinstall_file, @preinstall_copy_path)
|
49
|
+
else
|
50
|
+
FileUtils.rm(@preinstall_copy_path)
|
49
51
|
end
|
52
|
+
@postinstall_copy_path = File.join(output_dir, @copy_name[:postinstall])
|
50
53
|
if postinstall_file
|
51
|
-
@postinstall_copy_path = File.join(output_dir, @copy_name[:postinstall])
|
52
54
|
FileUtils.cp(postinstall_file, @postinstall_copy_path)
|
55
|
+
else
|
56
|
+
FileUtils.rm(@postinstall_copy_path)
|
53
57
|
end
|
54
58
|
end
|
55
59
|
|
@@ -112,12 +116,12 @@ module NiseBOSHVagrant
|
|
112
116
|
self.exec(install_cmd)
|
113
117
|
end
|
114
118
|
|
115
|
-
def
|
119
|
+
def run_preinstall_release(release_path=@release_path)
|
116
120
|
hook_cmd = "cd #{release_path} ; vagrant ssh -c \"/home/vagrant/preinstall_release\""
|
117
121
|
self.exec(hook_cmd)
|
118
122
|
end
|
119
123
|
|
120
|
-
def
|
124
|
+
def run_postinstall_release(release_path=@release_path)
|
121
125
|
hook_cmd = "cd #{release_path} ; vagrant ssh -c \"/home/vagrant/postinstall_release\""
|
122
126
|
self.exec(hook_cmd)
|
123
127
|
end
|
data/scripts/prepare.sh
CHANGED
@@ -44,7 +44,6 @@ chmod +x /home/vagrant/start.sh
|
|
44
44
|
|
45
45
|
# Copy hook scripts
|
46
46
|
for hook in preinstall postinstall; do
|
47
|
-
echo ${hook}
|
48
47
|
if [ -f /home/vagrant/release/.nise-bosh-${hook} ]; then
|
49
48
|
cp /home/vagrant/release/.nise-bosh-${hook} /home/vagrant/${hook}_release
|
50
49
|
chmod +x /home/vagrant/${hook}_release
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nise-bosh-vagrant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -65,7 +65,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
65
65
|
version: '0'
|
66
66
|
segments:
|
67
67
|
- 0
|
68
|
-
hash: -
|
68
|
+
hash: -696603529254147692
|
69
69
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
70
|
none: false
|
71
71
|
requirements:
|