vanagon 0.16.1 → 0.19.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +48 -23
- data/bin/build +3 -1
- data/bin/build_host_info +3 -1
- data/bin/build_requirements +3 -1
- data/bin/inspect +3 -1
- data/bin/render +3 -1
- data/bin/repo +3 -1
- data/bin/ship +3 -1
- data/bin/sign +3 -1
- data/extras/completions/vanagon.bash +38 -0
- data/extras/completions/vanagon.zsh +41 -0
- data/lib/vanagon/cli.rb +12 -2
- data/lib/vanagon/cli/build.rb +12 -3
- data/lib/vanagon/cli/build_host_info.rb +12 -3
- data/lib/vanagon/cli/build_requirements.rb +13 -5
- data/lib/vanagon/cli/completion.rb +44 -0
- data/lib/vanagon/cli/inspect.rb +12 -3
- data/lib/vanagon/cli/list.rb +74 -0
- data/lib/vanagon/cli/render.rb +11 -2
- data/lib/vanagon/cli/ship.rb +5 -4
- data/lib/vanagon/cli/sign.rb +3 -2
- data/lib/vanagon/component.rb +11 -9
- data/lib/vanagon/component/dsl.rb +6 -5
- data/lib/vanagon/component/source.rb +2 -1
- data/lib/vanagon/component/source/git.rb +7 -6
- data/lib/vanagon/component/source/http.rb +3 -2
- data/lib/vanagon/component/source/local.rb +2 -1
- data/lib/vanagon/component/source/rewrite.rb +3 -2
- data/lib/vanagon/driver.rb +35 -34
- data/lib/vanagon/engine/always_be_scheduling.rb +272 -1
- data/lib/vanagon/engine/docker.rb +2 -1
- data/lib/vanagon/engine/ec2.rb +5 -4
- data/lib/vanagon/engine/hardware.rb +4 -3
- data/lib/vanagon/engine/pooler.rb +13 -8
- data/lib/vanagon/environment.rb +3 -2
- data/lib/vanagon/logger.rb +31 -0
- data/lib/vanagon/platform.rb +6 -5
- data/lib/vanagon/platform/deb.rb +2 -0
- data/lib/vanagon/platform/dsl.rb +5 -4
- data/lib/vanagon/platform/windows.rb +3 -1
- data/lib/vanagon/project.rb +20 -14
- data/lib/vanagon/project/dsl.rb +6 -5
- data/lib/vanagon/utilities.rb +35 -12
- data/resources/deb/control.erb +1 -1
- data/resources/osx/postinstall.erb +5 -1
- data/resources/rpm/project.spec.erb +1 -1
- data/resources/solaris/10/depend.erb +2 -2
- data/resources/solaris/10/postinstall.erb +10 -2
- data/resources/solaris/11/p5m.erb +2 -2
- data/spec/lib/vanagon/cli_spec.rb +143 -0
- data/spec/lib/vanagon/component/dsl_spec.rb +9 -2
- data/spec/lib/vanagon/component_spec.rb +3 -2
- data/spec/lib/vanagon/driver_spec.rb +1 -1
- data/spec/lib/vanagon/engine/always_be_scheduling_spec.rb +113 -1
- data/spec/lib/vanagon/engine/ec2_spec.rb +2 -0
- data/spec/lib/vanagon/engine/pooler_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- metadata +32 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5dc9e0c896685503aafc10ec2bae7531dd36299289a7b07850db2ec5547f32c
|
4
|
+
data.tar.gz: 8ec86222166a7d4ecd99026c3ca0e46793f2da2b3f284eafe024236bc2449d56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54be38ffc28ceb63f22de1dd5912c823881f7d5c0188733960ddfa2c170c959174b181491db92007f8319a762f22cef0ed417ecf44bf3ad7f1305c18e7b89e56
|
7
|
+
data.tar.gz: ea4ff7c8f3ed9ebafc4e9fefbb689464431ff22299fb7c4bc9d1582451c249dba8628c28426b2d9cd9c46526a4e9be9ded30c060bbe70acb5b2d6cb3021174b0
|
data/README.md
CHANGED
@@ -45,9 +45,10 @@ Also, Vanagon ships with a number of engines which may include additional option
|
|
45
45
|
|
46
46
|
### Local Host:
|
47
47
|
|
48
|
-
- [Ruby](https://www.ruby-lang.org/en/) (Ruby 2.
|
48
|
+
- [Ruby](https://www.ruby-lang.org/en/) (Ruby 2.3.x is the miniumum supported version)
|
49
49
|
- [fustigit](https://github.com/mckern/fustigit)
|
50
50
|
- [ruby-git](https://github.com/schacon/ruby-git)
|
51
|
+
- [docopt](https://github.com/docopt/docopt.rb)
|
51
52
|
- The command line tool `ssh` ([homepage](https://www.openssh.com/)) available on the local `${PATH}` (any modern version should suffice)
|
52
53
|
- The command line tool `rsync` ([homepage](https://rsync.samba.org/)) available on the local `${PATH}` (At least rsync 2.6.x)
|
53
54
|
- The command line tool `git` ([homepage](https://git-scm.com/)) available on the local `${PATH}` (Vanagon is tested against Git version 1.8.x but should work with any newer version)
|
@@ -84,10 +85,28 @@ wheezy and build my project against it.
|
|
84
85
|
For more detailed examples of the DSLs available, please see the
|
85
86
|
[examples](examples) directory and the YARD documentation for Vanagon.
|
86
87
|
|
87
|
-
###
|
88
|
+
### CLI changes and deprecations (from version 0.16.0)
|
89
|
+
|
90
|
+
Prior to 0.16.0, the vanagon command line contained these commands
|
91
|
+
|
92
|
+
* `build`
|
93
|
+
* `build_host_info`
|
94
|
+
* `build_requirements`
|
95
|
+
* `inspect`
|
96
|
+
* `render`
|
97
|
+
* `repo`
|
98
|
+
* `ship`
|
99
|
+
* `sign`
|
100
|
+
|
101
|
+
With the exception of `repo`, which calls `packaging` methods, the remaining commands
|
102
|
+
have been moved to a git-like pattern of `vanagon <subcommand>`. `vangon build` replaced `build`, `vanagon ship` replaced `ship` and so forth.
|
103
|
+
|
104
|
+
The older calling usage is deprecated.
|
105
|
+
|
106
|
+
### `vanagon build` usage
|
88
107
|
The build command has positional arguments and position independent flags.
|
89
108
|
|
90
|
-
####
|
109
|
+
#### Positional arguments
|
91
110
|
|
92
111
|
##### project name
|
93
112
|
The name of the project to build; a file named `<project_name>.rb` must be
|
@@ -114,7 +133,8 @@ Build machines should be cleaned between builds.
|
|
114
133
|
|
115
134
|
#### Flagged arguments
|
116
135
|
|
117
|
-
**Note:** command flags can be used anywhere in the command.
|
136
|
+
**Note:** command flags currently can be used anywhere in the command. Recommended usages
|
137
|
+
is to use flagged arguments before the positional arguments.
|
118
138
|
|
119
139
|
##### -w DIR, --workdir DIR
|
120
140
|
Specifies a directory on the local host where the sources should be placed and builds performed.
|
@@ -134,9 +154,10 @@ Currently supported engines are:
|
|
134
154
|
* `base` - Pure ssh backend; no teardown currently defined
|
135
155
|
* `local` - Build on the local machine; platform name must match the local machine
|
136
156
|
* `docker` - Builds in a docker container
|
137
|
-
* `pooler` - Selects a vm from Puppet
|
157
|
+
* `pooler` - Selects a vm from Puppet's internal vmpooler to build on
|
138
158
|
* `hardware` - Build on a specific taget and lock it in redis
|
139
159
|
* `ec2` - Build on a specific AWS instance.
|
160
|
+
* `ABS` - Selects a vm from Puppet's internal Always-be-scheduling service to build on
|
140
161
|
|
141
162
|
#### Flags
|
142
163
|
|
@@ -147,9 +168,6 @@ Indicates that the host used for building the project should be left intact
|
|
147
168
|
after the build instead of destroyed. The host is usually destroyed after a
|
148
169
|
successful build, or left after a failed build.
|
149
170
|
|
150
|
-
##### -v, --verbose
|
151
|
-
(Reserved for future implementation) Will increase the verbosity of output, when implemented.
|
152
|
-
|
153
171
|
##### -h, --help
|
154
172
|
Display command-line help.
|
155
173
|
|
@@ -195,16 +213,16 @@ integer value these components to fail after the `VANAGON_TIMEOUT` count is reac
|
|
195
213
|
Note that this value is expected to be in seconds.
|
196
214
|
|
197
215
|
#### Example usage
|
198
|
-
`build --preserve puppet-agent el-6-i386` will build the puppet-agent project
|
216
|
+
`vanagon build --preserve puppet-agent el-6-i386` will build the puppet-agent project
|
199
217
|
on the el-6-i386 platform and leave the host intact afterward.
|
200
218
|
|
201
|
-
`build --engine=docker puppet-agent el-6-i386` will build the puppet-agent
|
219
|
+
`vanagon build --engine=docker puppet-agent el-6-i386` will build the puppet-agent
|
202
220
|
project on the el-6-i386 platform using the docker engine (the platform must
|
203
221
|
have a docker\_image defined in its config).
|
204
222
|
|
205
223
|
---
|
206
224
|
|
207
|
-
### `inspect` usage
|
225
|
+
### `vanagon inspect` usage
|
208
226
|
|
209
227
|
The `inspect` command has positional arguments and position independent flags. It
|
210
228
|
mirrors the `build` command, but exits with success after loading and interpolating
|
@@ -212,7 +230,7 @@ all of the components in the given project. No attempt is made to actually build
|
|
212
230
|
the given project; instead, a JSON formatted array of hashes is returned and printed
|
213
231
|
to `stdout`. This JSON array can be further processed by external tooling, such as `jq`.
|
214
232
|
|
215
|
-
####
|
233
|
+
#### Positional arguments
|
216
234
|
|
217
235
|
##### project name
|
218
236
|
The name of the project to build, and a file named \<project\_name\>.rb must be
|
@@ -227,7 +245,8 @@ Platform can also be a comma separated list of platforms such as platform1,platf
|
|
227
245
|
|
228
246
|
#### Flagged arguments
|
229
247
|
|
230
|
-
**Note:** command flags can be used anywhere in the command.
|
248
|
+
**Note:** command flags currently can be used anywhere in the command. Recommended usages
|
249
|
+
is to use flagged arguments before the positional arguments.
|
231
250
|
|
232
251
|
##### -w DIR, --workdir DIR
|
233
252
|
Specifies a directory where the sources should be placed and builds performed.
|
@@ -239,29 +258,24 @@ Specifies where project configuration is found. Defaults to $pwd/configs.
|
|
239
258
|
##### -e ENGINE, --engine ENGINE
|
240
259
|
Choose a different virtualization engine to use to select the build target.
|
241
260
|
Engines are respected, but only insofar as components and projects are
|
242
|
-
rendered -- the `inspect` command performs no compilation.
|
261
|
+
rendered -- the `vanagon inspect` command performs no compilation.
|
243
262
|
|
244
|
-
Supported engines are the same as the `build` command.
|
263
|
+
Supported engines are the same as the `vanagon build` command.
|
245
264
|
|
246
265
|
#### Flags
|
247
266
|
|
248
|
-
**Note:** command flags can be used anywhere in the command.
|
249
|
-
|
250
|
-
##### -v, --verbose (not yet implemented)
|
251
|
-
Increase verbosity of output.
|
252
|
-
|
253
267
|
##### -h, --help
|
254
268
|
Display command-line help.
|
255
269
|
|
256
270
|
#### Environment variables
|
257
271
|
|
258
272
|
Environment variables are respected, but only insofar as components and projects are
|
259
|
-
rendered -- the `inspect` command has no behavior to alter.
|
273
|
+
rendered -- the `vanagon inspect` command has no behavior to alter.
|
260
274
|
|
261
|
-
Supported environment variables are the same as the `build` command.
|
275
|
+
Supported environment variables are the same as the `vanagon build` command.
|
262
276
|
|
263
277
|
#### Example usage
|
264
|
-
`inspect puppet-agent el-6-i386` will load the puppet-agent project
|
278
|
+
`vanagon inspect puppet-agent el-6-i386` will load the puppet-agent project
|
265
279
|
on the el-6-i386 platform and print the resulting list of dependencies,
|
266
280
|
build-time configuration, environment variables, and expected artifacts.
|
267
281
|
|
@@ -297,6 +311,16 @@ platform "el-7-x86_64" do |plat|
|
|
297
311
|
end
|
298
312
|
```
|
299
313
|
|
314
|
+
### ABS (internal)
|
315
|
+
When using the ABS engine, there is a variety of ways you can specify your token:
|
316
|
+
- the environment variable ABS_TOKEN
|
317
|
+
- or vanagon token file ~/.vanagon-token (note this is the same file read by the pooler engine)
|
318
|
+
- or [vmfloaty](https://github.com/puppetlabs/vmfloaty)'s config file ~/.vmfloaty.yml
|
319
|
+
|
320
|
+
In order to modify or track the VM via floaty or bit-bar you can optionally add the vmpooler token (different from the ABS token) via
|
321
|
+
- VMPOOLER_TOKEN
|
322
|
+
- or as a second line to the file ~/.vanagon-token
|
323
|
+
- or by using the existing mechanism in floaty using a vmpooler_fallback
|
300
324
|
|
301
325
|
Contributing
|
302
326
|
---
|
@@ -310,3 +334,4 @@ See [LICENSE](LICENSE) file.
|
|
310
334
|
|
311
335
|
## Maintainers
|
312
336
|
See [MAINTAINERS](MAINTAINERS) file.
|
337
|
+
|
data/bin/build
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
require 'vanagon/logger'
|
4
|
+
|
3
5
|
script = File.basename($0)
|
4
6
|
|
5
|
-
|
7
|
+
VanagonLogger.info "#{script}: Warning: use of stand alone '#{script}' command is deprecated and may be removed.
|
6
8
|
Use: 'vanagon #{script}' instead."
|
7
9
|
|
8
10
|
exec "vanagon", script, *ARGV
|
data/bin/build_host_info
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
require 'vanagon/logger'
|
4
|
+
|
3
5
|
script = File.basename($0)
|
4
6
|
|
5
|
-
|
7
|
+
VanagonLogger.info "#{script}: Warning: use of stand alone '#{script}' command is deprecated and may be removed.
|
6
8
|
Use: 'vanagon #{script}' instead."
|
7
9
|
|
8
10
|
exec "vanagon", script, *ARGV
|
data/bin/build_requirements
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
require 'vanagon/logger'
|
4
|
+
|
3
5
|
script = File.basename($0)
|
4
6
|
|
5
|
-
|
7
|
+
VanagonLogger.info "#{script}: Warning: use of stand alone '#{script}' command is deprecated and may be removed.
|
6
8
|
Use: 'vanagon #{script}' instead."
|
7
9
|
|
8
10
|
exec "vanagon", script, *ARGV
|
data/bin/inspect
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
require 'vanagon/logger'
|
4
|
+
|
3
5
|
script = File.basename($0)
|
4
6
|
|
5
|
-
|
7
|
+
VanagonLogger.info "#{script}: Warning: use of stand alone '#{script}' command is deprecated and may be removed.
|
6
8
|
Use: 'vanagon #{script}' instead."
|
7
9
|
|
8
10
|
exec "vanagon", script, *ARGV
|
data/bin/render
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
require 'vanagon/logger'
|
4
|
+
|
3
5
|
script = File.basename($0)
|
4
6
|
|
5
|
-
|
7
|
+
VanagonLogger.info "#{script}: Warning: use of stand alone '#{script}' command is deprecated and may be removed.
|
6
8
|
Use: 'vanagon #{script}' instead."
|
7
9
|
|
8
10
|
exec "vanagon", script, *ARGV
|
data/bin/repo
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
require 'vanagon/logger'
|
4
|
+
|
3
5
|
ENV["PROJECT_ROOT"] = Dir.pwd
|
4
6
|
|
5
7
|
# Begin warning: This ship script is an internal tool.
|
@@ -21,7 +23,7 @@ when 'rpm'
|
|
21
23
|
when 'deb'
|
22
24
|
Pkg::Util::RakeUtils.invoke_task('pl:jenkins:deb_repos')
|
23
25
|
when 'none'
|
24
|
-
|
26
|
+
VanagonLogger.warn "Skipping repo generation since repo target is set to 'none'"
|
25
27
|
else
|
26
28
|
Pkg::Util::RakeUtils.invoke_task('pl:jenkins:rpm_repos')
|
27
29
|
Pkg::Util::RakeUtils.invoke_task('pl:jenkins:deb_repos')
|
data/bin/ship
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
require 'vanagon/logger'
|
4
|
+
|
3
5
|
script = File.basename($0)
|
4
6
|
|
5
|
-
|
7
|
+
VanagonLogger.info "#{script}: Warning: use of stand alone '#{script}' command is deprecated and may be removed.
|
6
8
|
Use: 'vanagon #{script}' instead."
|
7
9
|
|
8
10
|
exec "vanagon", script, *ARGV
|
data/bin/sign
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
require 'vanagon/logger'
|
4
|
+
|
3
5
|
script = File.basename($0)
|
4
6
|
|
5
|
-
|
7
|
+
VanagonLogger.info "#{script}: Warning: use of stand alone '#{script}' command is deprecated and may be removed.
|
6
8
|
Use: 'vanagon #{script}' instead."
|
7
9
|
|
8
10
|
exec "vanagon", script, *ARGV
|
@@ -0,0 +1,38 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
_vanagon()
|
4
|
+
{
|
5
|
+
local cur prev projects commands template_arg_commands
|
6
|
+
|
7
|
+
# COMREPLY is an array variable used to store completions
|
8
|
+
# the completion mechanism uses COMPRELY to display its contents as completions
|
9
|
+
# COMP_WORDS is an array of all the words typed after the name of the program
|
10
|
+
# COMP_CWORD is an index of the COMP_WORDS array pointing to the current word
|
11
|
+
COMPREPLY=()
|
12
|
+
cur="${COMP_WORDS[COMP_CWORD]}"
|
13
|
+
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
14
|
+
projects=($({ vanagon list -r | sed 1d; } 2>/dev/null))
|
15
|
+
commands="build build_host_info build_requirements completion inspect list render sign ship help"
|
16
|
+
template_arg_commands="build build_host_info build_requirements inspect render "
|
17
|
+
|
18
|
+
# completes with a project if the previous word was a command in template_arg_commands
|
19
|
+
if [[ $template_arg_commands =~ (^| )$prev($| ) ]] ; then
|
20
|
+
_vanagon_avail_templates_projects=$({ vanagon list -r | sed 1d; } 2>/dev/null)
|
21
|
+
# compgen generates completions filtered based on what has been typed by the user
|
22
|
+
COMPREPLY=( $(compgen -W "${_vanagon_avail_templates_projects}" -- "${cur}") )
|
23
|
+
fi
|
24
|
+
|
25
|
+
# allows multiple platforms to be tab completed
|
26
|
+
if [[ ${#COMP_WORDS[@]} -gt 3 ]] ; then
|
27
|
+
_vanagon_avail_templates_platforms=$({ vanagon list -l | sed 1d; } 2>/dev/null)
|
28
|
+
COMPREPLY=( $(compgen -W "${_vanagon_avail_templates_platforms}" -- "${cur}") )
|
29
|
+
fi
|
30
|
+
|
31
|
+
if [[ $1 == $prev ]] ; then
|
32
|
+
# only show top level commands we are at root
|
33
|
+
COMPREPLY=( $(compgen -W "${commands}" -- "${cur}") )
|
34
|
+
fi
|
35
|
+
}
|
36
|
+
|
37
|
+
# assign tab complete function `_vanagon ` to `vanagon` command
|
38
|
+
complete -F _vanagon vanagon
|
@@ -0,0 +1,41 @@
|
|
1
|
+
_vanagon()
|
2
|
+
{
|
3
|
+
local line commands template_arg_commands projects
|
4
|
+
|
5
|
+
commands="build build_host_info build_requirements completion inspect list render sign ship help"
|
6
|
+
template_arg_commands=("build" "build_host_info" "build_requirements" "inspect" "render")
|
7
|
+
projects=($({ vanagon list -r | sed 1d; } 2>/dev/null))
|
8
|
+
|
9
|
+
# '%p:globbed-files:' sets completion to only offer files matching a
|
10
|
+
# described pattern.
|
11
|
+
zstyle ':completion:*' file-patterns '%p:globbed-files:'
|
12
|
+
|
13
|
+
# arguments function provides potential completions to zsh
|
14
|
+
# specs are of the form n:message:action
|
15
|
+
_arguments -C \
|
16
|
+
": :(${commands})" \
|
17
|
+
"*::arg:->args"
|
18
|
+
|
19
|
+
# (Ie)prevents "invalid subscript"
|
20
|
+
if ((template_arg_commands[(Ie)$line[1]])); then
|
21
|
+
_vanagon_template_sub_projects
|
22
|
+
fi
|
23
|
+
if [[ $projects =~ (^| )$line[2]($| ) ]]; then
|
24
|
+
_vanagon_template_sub_platforms
|
25
|
+
fi
|
26
|
+
}
|
27
|
+
|
28
|
+
_vanagon_template_sub_projects()
|
29
|
+
{
|
30
|
+
# -W look in certain path but don't append path to tab compelte
|
31
|
+
# -g enables file matching pattern
|
32
|
+
# (:r) removes the file extension `.rb` from the completion
|
33
|
+
_arguments "1: :_files -W $(PWD)/configs/projects/ -g '*.rb(:r)'"
|
34
|
+
}
|
35
|
+
|
36
|
+
_vanagon_template_sub_platforms()
|
37
|
+
{
|
38
|
+
_arguments "*: :_files -W $(PWD)/configs/platforms/ -g '*.rb(:r)'"
|
39
|
+
}
|
40
|
+
# compdef registeres the completion function: compdef <function-name> <program>
|
41
|
+
compdef _vanagon vanagon
|
data/lib/vanagon/cli.rb
CHANGED
@@ -8,11 +8,15 @@ require 'vanagon/extensions/hashable'
|
|
8
8
|
require 'vanagon/cli/build'
|
9
9
|
require 'vanagon/cli/build_host_info'
|
10
10
|
require 'vanagon/cli/build_requirements'
|
11
|
+
require 'vanagon/cli/completion'
|
11
12
|
require 'vanagon/cli/inspect'
|
13
|
+
require 'vanagon/cli/list'
|
12
14
|
require 'vanagon/cli/render'
|
13
15
|
require 'vanagon/cli/ship'
|
14
16
|
require 'vanagon/cli/sign'
|
15
17
|
|
18
|
+
require 'vanagon/logger'
|
19
|
+
|
16
20
|
|
17
21
|
class Vanagon
|
18
22
|
class InvalidArgument < StandardError
|
@@ -27,7 +31,9 @@ class Vanagon
|
|
27
31
|
build build a package given a project and platform
|
28
32
|
build_host_info print information about build hosts
|
29
33
|
build_requirements print external packages required to build project
|
34
|
+
completion outputs path to tab completion script
|
30
35
|
inspect a build dry-run, printing lots of information about the build
|
36
|
+
list shows a list of available projects and platforms
|
31
37
|
render create local versions of packaging artifacts for project
|
32
38
|
sign sign a package
|
33
39
|
ship upload a package to a distribution server
|
@@ -46,10 +52,14 @@ class Vanagon
|
|
46
52
|
@sub_parser = Vanagon::CLI::BuildHostInfo.new
|
47
53
|
when 'build_requirements'
|
48
54
|
@sub_parser = Vanagon::CLI::BuildRequirements.new
|
55
|
+
when 'completion'
|
56
|
+
@sub_parser = Vanagon::CLI::Completion.new
|
49
57
|
when 'inspect'
|
50
58
|
@sub_parser = Vanagon::CLI::Inspect.new
|
51
59
|
when 'render'
|
52
60
|
@sub_parser = Vanagon::CLI::Render.new
|
61
|
+
when 'list'
|
62
|
+
@sub_parser = Vanagon::CLI::List.new
|
53
63
|
when 'sign'
|
54
64
|
@sub_parser = Vanagon::CLI::Sign.new
|
55
65
|
when 'ship'
|
@@ -58,7 +68,7 @@ class Vanagon
|
|
58
68
|
puts DOCUMENTATION
|
59
69
|
exit 0
|
60
70
|
else
|
61
|
-
|
71
|
+
VanagonLogger.error "vanagon: Error: unknown command: \"#{sub_command}\"\n\n#{DOCUMENTATION}"
|
62
72
|
exit 1
|
63
73
|
end
|
64
74
|
|
@@ -87,7 +97,7 @@ class Vanagon
|
|
87
97
|
def parse_options(argv)
|
88
98
|
Docopt.docopt(DOCUMENTATION, { argv: argv, options_first: true })
|
89
99
|
rescue Docopt::Exit => e
|
90
|
-
|
100
|
+
VanagonLogger.error e.message
|
91
101
|
exit 1
|
92
102
|
end
|
93
103
|
end
|
data/lib/vanagon/cli/build.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'docopt'
|
2
|
+
require 'vanagon/logger'
|
2
3
|
|
3
4
|
class Vanagon
|
4
5
|
class CLI
|
@@ -10,7 +11,7 @@ class Vanagon
|
|
10
11
|
Options:
|
11
12
|
-h, --help Display help
|
12
13
|
-c, --configdir DIRECTORY Configuration directory [default: #{Dir.pwd}/configs]
|
13
|
-
-e, --engine ENGINE Custom engine to use [
|
14
|
+
-e, --engine ENGINE Custom engine to use [default: always_be_scheduling]
|
14
15
|
-o, --only-build COMPONENT,COMPONENT,...
|
15
16
|
Only build listed COMPONENTs
|
16
17
|
-p, --preserve [RULE] Rule for VM preservation: never, on-failure, always
|
@@ -19,12 +20,20 @@ class Vanagon
|
|
19
20
|
-s, --skipcheck Skip the "check" stage when building components
|
20
21
|
-w, --workdir DIRECTORY Working directory on the local host
|
21
22
|
-v, --verbose Only here for backwards compatibility. Does nothing.
|
23
|
+
|
24
|
+
Engines:
|
25
|
+
always_be_scheduling: default engine using Puppet's ABS infrastructure
|
26
|
+
docker: a docker container on the local host
|
27
|
+
ec2: an Amazon EC2 instance
|
28
|
+
hardware: a dedicated hardware device
|
29
|
+
local: the local machine, cannot be used with a target
|
30
|
+
pooler: [deprecated] Puppet's vmpooler
|
22
31
|
DOCOPT
|
23
32
|
|
24
33
|
def parse(argv)
|
25
34
|
Docopt.docopt(DOCUMENTATION, { argv: argv })
|
26
35
|
rescue Docopt::Exit => e
|
27
|
-
|
36
|
+
VanagonLogger.error e.message
|
28
37
|
exit 1
|
29
38
|
end
|
30
39
|
|
@@ -38,7 +47,7 @@ class Vanagon
|
|
38
47
|
|
39
48
|
platform_list.zip(target_list).each do |pair|
|
40
49
|
platform, target = pair
|
41
|
-
artifact = Vanagon::Driver.new(platform, project, options.merge({
|
50
|
+
artifact = Vanagon::Driver.new(platform, project, options.merge({ :target => target }))
|
42
51
|
artifact.run
|
43
52
|
end
|
44
53
|
end
|