vanagon 0.15.35 → 0.16.1
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 +4 -4
- data/bin/build +4 -25
- data/bin/build_host_info +4 -17
- data/bin/build_requirements +4 -31
- data/bin/inspect +4 -21
- data/bin/render +4 -22
- data/bin/ship +4 -28
- data/bin/sign +4 -11
- data/bin/vanagon +7 -0
- data/lib/vanagon.rb +1 -1
- data/lib/vanagon/cli.rb +94 -0
- data/lib/vanagon/cli/build.rb +75 -0
- data/lib/vanagon/cli/build_host_info.rb +49 -0
- data/lib/vanagon/cli/build_requirements.rb +60 -0
- data/lib/vanagon/cli/inspect.rb +65 -0
- data/lib/vanagon/cli/render.rb +51 -0
- data/lib/vanagon/cli/ship.rb +52 -0
- data/lib/vanagon/cli/sign.rb +34 -0
- data/lib/vanagon/driver.rb +11 -7
- data/lib/vanagon/engine/docker.rb +101 -14
- data/lib/vanagon/platform.rb +9 -3
- data/lib/vanagon/platform/deb.rb +1 -1
- data/lib/vanagon/platform/dsl.rb +11 -0
- data/lib/vanagon/platform/rpm.rb +1 -1
- data/lib/vanagon/platform/windows.rb +29 -2
- data/lib/vanagon/project.rb +23 -4
- data/lib/vanagon/project/dsl.rb +33 -0
- data/resources/rpm/project.spec.erb +9 -0
- data/spec/lib/vanagon/cli_spec.rb +80 -0
- data/spec/lib/vanagon/engine/docker_spec.rb +74 -16
- metadata +55 -32
- data/lib/vanagon/optparse.rb +0 -86
- data/spec/lib/vanagon/optparse_spec.rb +0 -64
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vanagon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.16.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet Labs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: docopt
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: git
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -70,6 +84,7 @@ description: Vanagon is a tool to build a single package out of a project, which
|
|
70
84
|
itself contain one or more components.
|
71
85
|
email: info@puppet.com
|
72
86
|
executables:
|
87
|
+
- vanagon
|
73
88
|
- build
|
74
89
|
- inspect
|
75
90
|
- ship
|
@@ -91,10 +106,19 @@ files:
|
|
91
106
|
- bin/repo
|
92
107
|
- bin/ship
|
93
108
|
- bin/sign
|
109
|
+
- bin/vanagon
|
94
110
|
- lib/git/basic_submodules.rb
|
95
111
|
- lib/git/rev_list.rb
|
96
112
|
- lib/makefile.rb
|
97
113
|
- lib/vanagon.rb
|
114
|
+
- lib/vanagon/cli.rb
|
115
|
+
- lib/vanagon/cli/build.rb
|
116
|
+
- lib/vanagon/cli/build_host_info.rb
|
117
|
+
- lib/vanagon/cli/build_requirements.rb
|
118
|
+
- lib/vanagon/cli/inspect.rb
|
119
|
+
- lib/vanagon/cli/render.rb
|
120
|
+
- lib/vanagon/cli/ship.rb
|
121
|
+
- lib/vanagon/cli/sign.rb
|
98
122
|
- lib/vanagon/common.rb
|
99
123
|
- lib/vanagon/common/pathname.rb
|
100
124
|
- lib/vanagon/common/user.rb
|
@@ -120,7 +144,6 @@ files:
|
|
120
144
|
- lib/vanagon/extensions/ostruct/json.rb
|
121
145
|
- lib/vanagon/extensions/set/json.rb
|
122
146
|
- lib/vanagon/extensions/string.rb
|
123
|
-
- lib/vanagon/optparse.rb
|
124
147
|
- lib/vanagon/patch.rb
|
125
148
|
- lib/vanagon/platform.rb
|
126
149
|
- lib/vanagon/platform/deb.rb
|
@@ -204,6 +227,7 @@ files:
|
|
204
227
|
- spec/fixtures/wix/resources/windows/wix/ui/ui-sample-1.wxs
|
205
228
|
- spec/lib/git/rev_list_spec.rb
|
206
229
|
- spec/lib/makefile_spec.rb
|
230
|
+
- spec/lib/vanagon/cli_spec.rb
|
207
231
|
- spec/lib/vanagon/common/pathname_spec.rb
|
208
232
|
- spec/lib/vanagon/common/user_spec.rb
|
209
233
|
- spec/lib/vanagon/component/dsl_spec.rb
|
@@ -226,7 +250,6 @@ files:
|
|
226
250
|
- spec/lib/vanagon/extensions/ostruct/json_spec.rb
|
227
251
|
- spec/lib/vanagon/extensions/set/json_spec.rb
|
228
252
|
- spec/lib/vanagon/extensions/string_spec.rb
|
229
|
-
- spec/lib/vanagon/optparse_spec.rb
|
230
253
|
- spec/lib/vanagon/platform/deb_spec.rb
|
231
254
|
- spec/lib/vanagon/platform/dsl_spec.rb
|
232
255
|
- spec/lib/vanagon/platform/osx_spec.rb
|
@@ -265,41 +288,41 @@ signing_key:
|
|
265
288
|
specification_version: 3
|
266
289
|
summary: All of your packages will fit into this van with this one simple trick.
|
267
290
|
test_files:
|
268
|
-
- spec/lib/
|
291
|
+
- spec/lib/vanagon/platform/rpm/aix_spec.rb
|
292
|
+
- spec/lib/vanagon/platform/osx_spec.rb
|
293
|
+
- spec/lib/vanagon/platform/windows_spec.rb
|
294
|
+
- spec/lib/vanagon/platform/rpm_spec.rb
|
295
|
+
- spec/lib/vanagon/platform/deb_spec.rb
|
296
|
+
- spec/lib/vanagon/platform/solaris_11_spec.rb
|
297
|
+
- spec/lib/vanagon/platform/solaris_10_spec.rb
|
298
|
+
- spec/lib/vanagon/platform/dsl_spec.rb
|
299
|
+
- spec/lib/vanagon/driver_spec.rb
|
300
|
+
- spec/lib/vanagon/project/dsl_spec.rb
|
301
|
+
- spec/lib/vanagon/utilities_spec.rb
|
302
|
+
- spec/lib/vanagon/cli_spec.rb
|
303
|
+
- spec/lib/vanagon/environment_spec.rb
|
304
|
+
- spec/lib/vanagon/component/rules_spec.rb
|
305
|
+
- spec/lib/vanagon/component/source_spec.rb
|
306
|
+
- spec/lib/vanagon/component/source/local_spec.rb
|
307
|
+
- spec/lib/vanagon/component/source/git_spec.rb
|
308
|
+
- spec/lib/vanagon/component/source/http_spec.rb
|
309
|
+
- spec/lib/vanagon/component/source/rewrite_spec.rb
|
310
|
+
- spec/lib/vanagon/component/dsl_spec.rb
|
269
311
|
- spec/lib/vanagon/utilities/shell_utilities_spec.rb
|
270
|
-
- spec/lib/vanagon/platform_spec.rb
|
271
|
-
- spec/lib/vanagon/project_spec.rb
|
272
|
-
- spec/lib/vanagon/component_spec.rb
|
273
312
|
- spec/lib/vanagon/extensions/set/json_spec.rb
|
274
313
|
- spec/lib/vanagon/extensions/string_spec.rb
|
275
314
|
- spec/lib/vanagon/extensions/ostruct/json_spec.rb
|
276
|
-
- spec/lib/vanagon/
|
315
|
+
- spec/lib/vanagon/component_spec.rb
|
316
|
+
- spec/lib/vanagon/platform_spec.rb
|
317
|
+
- spec/lib/vanagon/engine/local_spec.rb
|
277
318
|
- spec/lib/vanagon/engine/hardware_spec.rb
|
278
|
-
- spec/lib/vanagon/engine/pooler_spec.rb
|
279
319
|
- spec/lib/vanagon/engine/always_be_scheduling_spec.rb
|
280
|
-
- spec/lib/vanagon/engine/
|
320
|
+
- spec/lib/vanagon/engine/pooler_spec.rb
|
281
321
|
- spec/lib/vanagon/engine/base_spec.rb
|
282
|
-
- spec/lib/vanagon/engine/
|
283
|
-
- spec/lib/vanagon/
|
284
|
-
- spec/lib/vanagon/utilities_spec.rb
|
285
|
-
- spec/lib/vanagon/driver_spec.rb
|
286
|
-
- spec/lib/vanagon/component/rules_spec.rb
|
287
|
-
- spec/lib/vanagon/component/dsl_spec.rb
|
288
|
-
- spec/lib/vanagon/component/source/rewrite_spec.rb
|
289
|
-
- spec/lib/vanagon/component/source/git_spec.rb
|
290
|
-
- spec/lib/vanagon/component/source/http_spec.rb
|
291
|
-
- spec/lib/vanagon/component/source/local_spec.rb
|
292
|
-
- spec/lib/vanagon/component/source_spec.rb
|
293
|
-
- spec/lib/vanagon/project/dsl_spec.rb
|
294
|
-
- spec/lib/vanagon/optparse_spec.rb
|
322
|
+
- spec/lib/vanagon/engine/ec2_spec.rb
|
323
|
+
- spec/lib/vanagon/engine/docker_spec.rb
|
295
324
|
- spec/lib/vanagon/common/user_spec.rb
|
296
325
|
- spec/lib/vanagon/common/pathname_spec.rb
|
297
|
-
- spec/lib/vanagon/
|
298
|
-
- spec/lib/
|
299
|
-
- spec/lib/vanagon/platform/solaris_10_spec.rb
|
300
|
-
- spec/lib/vanagon/platform/deb_spec.rb
|
301
|
-
- spec/lib/vanagon/platform/solaris_11_spec.rb
|
302
|
-
- spec/lib/vanagon/platform/rpm/aix_spec.rb
|
303
|
-
- spec/lib/vanagon/platform/osx_spec.rb
|
304
|
-
- spec/lib/vanagon/platform/rpm_spec.rb
|
326
|
+
- spec/lib/vanagon/project_spec.rb
|
327
|
+
- spec/lib/makefile_spec.rb
|
305
328
|
- spec/lib/git/rev_list_spec.rb
|
data/lib/vanagon/optparse.rb
DELETED
@@ -1,86 +0,0 @@
|
|
1
|
-
require 'optparse'
|
2
|
-
|
3
|
-
class Vanagon
|
4
|
-
class OptParse
|
5
|
-
def initialize(banner, symbols = []) # rubocop:disable Metrics/AbcSize
|
6
|
-
## symbols array kept for backward compatibility but ignored
|
7
|
-
|
8
|
-
@options = Hash.new
|
9
|
-
@options[:preserve] = :'on-failure'
|
10
|
-
|
11
|
-
@option_parser = OptionParser.new do |opts| # rubocop:disable Metrics/BlockLength
|
12
|
-
opts.banner = banner
|
13
|
-
opts.separator ""
|
14
|
-
opts.separator "Options:"
|
15
|
-
|
16
|
-
opts.on("-h",
|
17
|
-
"--help",
|
18
|
-
"Display help") do
|
19
|
-
$stdout.puts opts
|
20
|
-
exit 1
|
21
|
-
end
|
22
|
-
|
23
|
-
opts.on("-v",
|
24
|
-
"--verbose",
|
25
|
-
"Verbose output (does nothing)") do |verbose|
|
26
|
-
@options[:verbose] = verbose
|
27
|
-
end
|
28
|
-
|
29
|
-
opts.on("-w DIRECTORY",
|
30
|
-
"--workdir DIRECTORY",
|
31
|
-
"Working directory on the local host (defaults to calling mktemp)") do |workdir|
|
32
|
-
@options[:workdir] = workdir
|
33
|
-
end
|
34
|
-
|
35
|
-
opts.on("-r DIRECTORY",
|
36
|
-
"--remote-workdir DIRECTORY",
|
37
|
-
"Working directory on the remote host (defaults to calling mktemp)") do |remote|
|
38
|
-
@options[:"remote-workdir"] = remote
|
39
|
-
end
|
40
|
-
|
41
|
-
opts.on("-c DIRECTORY",
|
42
|
-
"--configdir DIRECTORY",
|
43
|
-
"Configuration directory (defaults to $CWD/configs)") do |configuration_directory|
|
44
|
-
@options[:configdir] = configuration_directory
|
45
|
-
end
|
46
|
-
|
47
|
-
opts.on("-e ENGINE",
|
48
|
-
"--engine ENGINE",
|
49
|
-
"Custom engine to use [base, local, docker, pooler] (defaults to \"pooler\")") do |engine|
|
50
|
-
@options[:engine] = engine
|
51
|
-
end
|
52
|
-
|
53
|
-
opts.on("--skipcheck",
|
54
|
-
"Skip the \"check\" stage when building components") do |skipcheck|
|
55
|
-
@options[:skipcheck] = skipcheck
|
56
|
-
end
|
57
|
-
|
58
|
-
opts.on("-p [RULE]",
|
59
|
-
"--preserve [RULE]",
|
60
|
-
["never", "on-failure", "always"],
|
61
|
-
"Rule for VM preservation. [never, on-failure, always]") do |rule|
|
62
|
-
if rule.nil?
|
63
|
-
@options[:preserve] = :always
|
64
|
-
else
|
65
|
-
@options[:preserve] = rule.to_sym
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
opts.on("--only-build COMPONENT,COMPONENT,...",
|
70
|
-
Array,
|
71
|
-
"Only build listed COMPONENTs") do |components|
|
72
|
-
@options[:only_build] = components
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
def parse!(args)
|
78
|
-
@option_parser.parse!(args)
|
79
|
-
@options
|
80
|
-
end
|
81
|
-
|
82
|
-
def to_s
|
83
|
-
@optparse.to_s
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
@@ -1,64 +0,0 @@
|
|
1
|
-
require 'vanagon/optparse'
|
2
|
-
|
3
|
-
describe Vanagon::OptParse do
|
4
|
-
|
5
|
-
describe "options that don't take a value" do
|
6
|
-
[:skipcheck, :verbose].each do |flag|
|
7
|
-
it "can create an option parser that accepts the #{flag} flag" do
|
8
|
-
subject = described_class.new("test", [flag])
|
9
|
-
expect(subject.parse!(["--#{flag}"])).to have_key(flag)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
describe "short options" do
|
14
|
-
[["v", :verbose]].each do |short, long|
|
15
|
-
it "maps the short option #{short} to #{long}" do
|
16
|
-
subject = described_class.new("test", [long])
|
17
|
-
expect(subject.parse!(["-#{short}"])).to include(long => true)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
describe "options that only allow limited values" do
|
24
|
-
[[:preserve, ["always", "never", "on-failure"]]].each do |option, values|
|
25
|
-
values.each do |value|
|
26
|
-
it "can create a parser that accepts \"--#{option} #{value}\"" do
|
27
|
-
subject = described_class.new("test", [option, value])
|
28
|
-
expect(subject.parse!(["--#{option}", value])).to eq(option => value.to_sym)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
[[:preserve, ["bad-argument"]]].each do |option, values|
|
33
|
-
values.each do |value|
|
34
|
-
it "rejects the bad argument \"--#{option} #{value}\"" do
|
35
|
-
subject = described_class.new("test", [option, value])
|
36
|
-
expect{subject.parse!(["--#{option}", value])}.to raise_error(OptionParser::InvalidArgument)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
it "preserve defaults to :on-failure" do
|
41
|
-
subject = described_class.new("test")
|
42
|
-
expect(subject.parse!([])).to include(:preserve => :'on-failure')
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
|
47
|
-
describe "options that take a value" do
|
48
|
-
[:workdir, :configdir, :engine].each do |option|
|
49
|
-
it "can create an option parser that accepts the #{option} option" do
|
50
|
-
subject = described_class.new("test", [option])
|
51
|
-
expect(subject.parse!(["--#{option}", "hello"])).to include(option => "hello")
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
describe "short options" do
|
56
|
-
[["w", :workdir], ["c", :configdir], ["e", :engine]].each do |short, long|
|
57
|
-
it "maps the short option #{short} to #{long}" do
|
58
|
-
subject = described_class.new("test", [long])
|
59
|
-
expect(subject.parse!(["-#{short}", "hello"])).to include(long => "hello")
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|