bosh-gen 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog.md +21 -0
- data/lib/bosh/gen/generators/package_generator.rb +40 -5
- data/lib/bosh/gen/version.rb +1 -1
- metadata +3 -3
data/ChangeLog.md
CHANGED
@@ -1,5 +1,26 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## v0.8.0
|
4
|
+
|
5
|
+
Changed:
|
6
|
+
|
7
|
+
* `package` - the `packaging` script include default tar/configure/make sequence for all tarballs
|
8
|
+
|
9
|
+
For example, `bosh-gen package nginx -f ..../blobs/nginx/`, the resulting `packaging` is:
|
10
|
+
|
11
|
+
``` bash
|
12
|
+
set -e # exit immediately if a simple command exits with a non-zero status
|
13
|
+
set -u # report the usage of uninitialized variables
|
14
|
+
|
15
|
+
export HOME=/var/vcap
|
16
|
+
|
17
|
+
tar xzf nginx/nginx-1.2.0.tar.gz
|
18
|
+
cd nginx-1.2.0
|
19
|
+
./configure --prefix=${BOSH_INSTALL_TARGET}
|
20
|
+
make
|
21
|
+
make install
|
22
|
+
```
|
23
|
+
|
3
24
|
## v0.7.0
|
4
25
|
|
5
26
|
Added:
|
@@ -35,17 +35,38 @@ module Bosh::Gen
|
|
35
35
|
|
36
36
|
def packaging
|
37
37
|
create_file package_dir("packaging") do
|
38
|
-
<<-SHELL.gsub(/^\s{10}/, '')
|
39
|
-
#
|
40
|
-
set -
|
38
|
+
packaging = <<-SHELL.gsub(/^\s{10}/, '')
|
39
|
+
set -e # exit immediately if a simple command exits with a non-zero status
|
40
|
+
set -u # report the usage of uninitialized variables
|
41
|
+
|
42
|
+
export HOME=/var/vcap
|
41
43
|
|
42
44
|
SHELL
|
45
|
+
|
46
|
+
dependencies.each do |package|
|
47
|
+
packaging << "PATH=/var/vcap/packages/#{package}/bin:$PATH\n"
|
48
|
+
end
|
49
|
+
|
50
|
+
tarballs_in_files.each do |tarball_file|
|
51
|
+
package_file = File.basename(tarball_file)
|
52
|
+
unpacked_path = unpacked_path_for_tarball(tarball_file)
|
53
|
+
|
54
|
+
packaging << <<-SHELL.gsub(/^\s{12}/, '')
|
55
|
+
|
56
|
+
tar xzf #{name}/#{package_file}
|
57
|
+
cd #{unpacked_path}
|
58
|
+
./configure --prefix=${BOSH_INSTALL_TARGET}
|
59
|
+
make
|
60
|
+
make install
|
61
|
+
SHELL
|
62
|
+
end
|
63
|
+
packaging
|
43
64
|
end
|
44
65
|
|
45
66
|
create_file package_dir("pre_packaging") do
|
46
67
|
<<-SHELL.gsub(/^\s{10}/, '')
|
47
|
-
#
|
48
|
-
set -
|
68
|
+
set -e # exit immediately if a simple command exits with a non-zero status
|
69
|
+
set -u # report the usage of uninitialized variables
|
49
70
|
|
50
71
|
SHELL
|
51
72
|
end
|
@@ -101,6 +122,20 @@ module Bosh::Gen
|
|
101
122
|
end
|
102
123
|
end
|
103
124
|
end
|
125
|
+
|
126
|
+
# Returns all .tar.gz in the files list
|
127
|
+
def tarballs_in_files
|
128
|
+
files.select { |file| file =~ /.tar.gz/ }
|
129
|
+
end
|
130
|
+
|
131
|
+
# If primary_package_file was mysql's client-5.1.62-rel13.3-435-Linux-x86_64.tar.gz
|
132
|
+
# then returns "client-5.1.62-rel13.3-435-Linux-x86_64"
|
133
|
+
#
|
134
|
+
# Assumes that first line of "tar tfz TARBALL" is the unpacking path
|
135
|
+
def unpacked_path_for_tarball(tarball_path)
|
136
|
+
file = `tar tfz #{tarball_path} | head -n 1`
|
137
|
+
File.basename(file.strip)
|
138
|
+
end
|
104
139
|
end
|
105
140
|
end
|
106
141
|
end
|
data/lib/bosh/gen/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bosh-gen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -209,7 +209,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
209
209
|
version: '0'
|
210
210
|
segments:
|
211
211
|
- 0
|
212
|
-
hash:
|
212
|
+
hash: -3406333594034376682
|
213
213
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
214
214
|
none: false
|
215
215
|
requirements:
|
@@ -218,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
218
218
|
version: '0'
|
219
219
|
segments:
|
220
220
|
- 0
|
221
|
-
hash:
|
221
|
+
hash: -3406333594034376682
|
222
222
|
requirements: []
|
223
223
|
rubyforge_project:
|
224
224
|
rubygems_version: 1.8.24
|