vanagon 0.18.1 → 0.21.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- 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/lib/vanagon/cli.rb +4 -2
- data/lib/vanagon/cli/build.rb +2 -1
- data/lib/vanagon/cli/build_host_info.rb +3 -2
- data/lib/vanagon/cli/build_requirements.rb +4 -4
- data/lib/vanagon/cli/completion.rb +4 -3
- data/lib/vanagon/cli/inspect.rb +3 -2
- data/lib/vanagon/cli/list.rb +16 -6
- data/lib/vanagon/cli/render.rb +2 -1
- data/lib/vanagon/cli/ship.rb +4 -19
- data/lib/vanagon/cli/sign.rb +3 -2
- data/lib/vanagon/component.rb +13 -10
- data/lib/vanagon/component/dsl.rb +27 -20
- data/lib/vanagon/component/source.rb +2 -1
- data/lib/vanagon/component/source/git.rb +35 -10
- 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 +20 -23
- data/lib/vanagon/engine/always_be_scheduling.rb +12 -11
- 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 +6 -5
- data/lib/vanagon/environment.rb +3 -2
- data/lib/vanagon/logger.rb +31 -0
- data/lib/vanagon/platform.rb +38 -5
- data/lib/vanagon/platform/defaults/debian-10-amd64.rb +11 -0
- data/lib/vanagon/platform/defaults/debian-8-amd64.rb +12 -0
- data/lib/vanagon/platform/defaults/debian-8-i386.rb +12 -0
- data/lib/vanagon/platform/defaults/debian-9-amd64.rb +12 -0
- data/lib/vanagon/platform/defaults/debian-9-i386.rb +12 -0
- data/lib/vanagon/platform/defaults/el-6-i386.rb +11 -0
- data/lib/vanagon/platform/defaults/el-6-x86_64.rb +11 -0
- data/lib/vanagon/platform/defaults/el-7-aarch64.rb +13 -0
- data/lib/vanagon/platform/defaults/el-7-x86_64.rb +11 -0
- data/lib/vanagon/platform/defaults/el-8-aarch64.rb +10 -0
- data/lib/vanagon/platform/defaults/el-8-x86_64.rb +10 -0
- data/lib/vanagon/platform/defaults/fedora-30-x86_64.rb +11 -0
- data/lib/vanagon/platform/defaults/fedora-31-x86_64.rb +11 -0
- data/lib/vanagon/platform/defaults/fedora-32-x86_64.rb +11 -0
- data/lib/vanagon/platform/defaults/osx-10.14-x86_64.rb +22 -0
- data/lib/vanagon/platform/defaults/osx-10.15-x86_64.rb +21 -0
- data/lib/vanagon/platform/defaults/redhatfips-7-x86_64.rb +11 -0
- data/lib/vanagon/platform/defaults/sles-12-x86_64.rb +11 -0
- data/lib/vanagon/platform/defaults/sles-15-x86_64.rb +10 -0
- data/lib/vanagon/platform/defaults/solaris-11-i386.rb +9 -0
- data/lib/vanagon/platform/defaults/solaris-11-sparc.rb +10 -0
- data/lib/vanagon/platform/defaults/ubuntu-16.04-amd64.rb +12 -0
- data/lib/vanagon/platform/defaults/ubuntu-16.04-i386.rb +12 -0
- data/lib/vanagon/platform/defaults/ubuntu-18.04-amd64.rb +12 -0
- data/lib/vanagon/platform/defaults/ubuntu-20.04-aarch64.rb +11 -0
- data/lib/vanagon/platform/defaults/ubuntu-20.04-amd64.rb +11 -0
- data/lib/vanagon/platform/dsl.rb +30 -6
- data/lib/vanagon/platform/windows.rb +3 -1
- data/lib/vanagon/project.rb +25 -15
- data/lib/vanagon/project/dsl.rb +6 -5
- data/lib/vanagon/utilities.rb +5 -4
- data/resources/deb/control.erb +1 -1
- data/resources/deb/postinst.erb +24 -13
- data/resources/deb/postrm.erb +9 -6
- data/resources/deb/prerm.erb +18 -8
- data/resources/osx/postinstall.erb +6 -2
- data/resources/rpm/project.spec.erb +12 -12
- data/resources/solaris/10/depend.erb +2 -2
- data/resources/solaris/10/postinstall.erb +11 -3
- data/resources/solaris/11/p5m.erb +2 -2
- data/spec/lib/vanagon/cli_spec.rb +57 -9
- data/spec/lib/vanagon/component/dsl_spec.rb +54 -10
- data/spec/lib/vanagon/component/source/git_spec.rb +4 -4
- data/spec/lib/vanagon/component_spec.rb +15 -2
- data/spec/lib/vanagon/engine/always_be_scheduling_spec.rb +4 -4
- data/spec/lib/vanagon/platform_spec.rb +80 -0
- data/spec/lib/vanagon/utilities_spec.rb +4 -1
- metadata +58 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e832c071ba2d54e8c938fbeace5fe1c0287bc25b2ff405b6b2d1ca5dbc9f44f
|
4
|
+
data.tar.gz: 1af5c0c38870de680a4cc1f037a94fa6595d22d0e9b70147371650beb11d7130
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53756b8e737fbe884d6e5ce934442778d07407b638d34186c1b19f658981b5e36a79d0c7c272b0efe82a7f86ded6479ab0a5e1fc7962b0112dfd85732168095c
|
7
|
+
data.tar.gz: 21b9ebef8bb1d8a54650c4a35551abdf8142d9e28689d843f96278ad81d5081877ec9eb6d4d9432799feb464a2f682754d78d3af6cf4b8c20d17bc0ea3c94145
|
data/README.md
CHANGED
@@ -197,8 +197,8 @@ Port of the system where redis is running. Defaults to *6379*.
|
|
197
197
|
##### `VANAGON_USE_MIRRORS`
|
198
198
|
Controls whether component sources are downloaded directly from upstream URLs
|
199
199
|
or from configured mirrors. Most Puppet projects using Vanagon default to
|
200
|
-
fetching components from internal mirrors. Set this variable to `n`
|
201
|
-
building outside of the Puppet private network to download directly from
|
200
|
+
fetching components from internal mirrors. Set this variable to `n` or `false`
|
201
|
+
when building outside of the Puppet private network to download directly from
|
202
202
|
upstream sources.
|
203
203
|
|
204
204
|
##### `VANAGON_RETRY_COUNT`
|
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
|
data/lib/vanagon/cli.rb
CHANGED
@@ -15,6 +15,8 @@ require 'vanagon/cli/render'
|
|
15
15
|
require 'vanagon/cli/ship'
|
16
16
|
require 'vanagon/cli/sign'
|
17
17
|
|
18
|
+
require 'vanagon/logger'
|
19
|
+
|
18
20
|
|
19
21
|
class Vanagon
|
20
22
|
class InvalidArgument < StandardError
|
@@ -66,7 +68,7 @@ class Vanagon
|
|
66
68
|
puts DOCUMENTATION
|
67
69
|
exit 0
|
68
70
|
else
|
69
|
-
|
71
|
+
VanagonLogger.error "vanagon: Error: unknown command: \"#{sub_command}\"\n\n#{DOCUMENTATION}"
|
70
72
|
exit 1
|
71
73
|
end
|
72
74
|
|
@@ -95,7 +97,7 @@ class Vanagon
|
|
95
97
|
def parse_options(argv)
|
96
98
|
Docopt.docopt(DOCUMENTATION, { argv: argv, options_first: true })
|
97
99
|
rescue Docopt::Exit => e
|
98
|
-
|
100
|
+
VanagonLogger.error e.message
|
99
101
|
exit 1
|
100
102
|
end
|
101
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
|
@@ -32,7 +33,7 @@ class Vanagon
|
|
32
33
|
def parse(argv)
|
33
34
|
Docopt.docopt(DOCUMENTATION, { argv: argv })
|
34
35
|
rescue Docopt::Exit => e
|
35
|
-
|
36
|
+
VanagonLogger.error e.message
|
36
37
|
exit 1
|
37
38
|
end
|
38
39
|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'docopt'
|
2
|
+
require 'vanagon/logger'
|
2
3
|
|
3
4
|
class Vanagon
|
4
5
|
class CLI
|
@@ -26,7 +27,7 @@ class Vanagon
|
|
26
27
|
def parse(argv)
|
27
28
|
Docopt.docopt(DOCUMENTATION, { argv: argv })
|
28
29
|
rescue Docopt::Exit => e
|
29
|
-
|
30
|
+
VanagonLogger.error e.message
|
30
31
|
exit 1
|
31
32
|
end
|
32
33
|
|
@@ -36,7 +37,7 @@ class Vanagon
|
|
36
37
|
|
37
38
|
platforms.each do |platform|
|
38
39
|
driver = Vanagon::Driver.new(platform, project, options)
|
39
|
-
|
40
|
+
VanagonLogger.warn JSON.generate(driver.build_host_info)
|
40
41
|
end
|
41
42
|
end
|
42
43
|
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'docopt'
|
2
2
|
require 'json'
|
3
|
+
require 'vanagon/logger'
|
3
4
|
|
4
5
|
class Vanagon
|
5
6
|
class CLI
|
@@ -27,7 +28,7 @@ class Vanagon
|
|
27
28
|
def parse(argv)
|
28
29
|
Docopt.docopt(DOCUMENTATION, { argv: argv })
|
29
30
|
rescue Docopt::Exit => e
|
30
|
-
|
31
|
+
VanagonLogger.error e.message
|
31
32
|
exit 1
|
32
33
|
end
|
33
34
|
|
@@ -47,9 +48,8 @@ class Vanagon
|
|
47
48
|
end
|
48
49
|
end
|
49
50
|
|
50
|
-
|
51
|
-
|
52
|
-
$stdout.puts JSON.pretty_generate(build_requirements.flatten.uniq.sort)
|
51
|
+
VanagonLogger.warn "**** External packages required to build #{project} on #{platform}: ***"
|
52
|
+
VanagonLogger.warn JSON.pretty_generate(build_requirements.flatten.uniq.sort)
|
53
53
|
end
|
54
54
|
|
55
55
|
def options_translate(docopt_options)
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'docopt'
|
2
|
+
require 'vanagon/logger'
|
2
3
|
|
3
4
|
class Vanagon
|
4
5
|
class CLI
|
@@ -15,7 +16,7 @@ class Vanagon
|
|
15
16
|
def parse(argv)
|
16
17
|
Docopt.docopt(DOCUMENTATION, { argv: argv })
|
17
18
|
rescue Docopt::Exit => e
|
18
|
-
|
19
|
+
VanagonLogger.error e.message
|
19
20
|
exit 1
|
20
21
|
end
|
21
22
|
|
@@ -24,10 +25,10 @@ class Vanagon
|
|
24
25
|
completion_file = File.expand_path(File.join('..', '..', '..', '..', 'extras', 'completions', "vanagon.#{shell}"), __FILE__)
|
25
26
|
|
26
27
|
if File.exist?(completion_file)
|
27
|
-
|
28
|
+
VanagonLogger.warn completion_file
|
28
29
|
exit 0
|
29
30
|
else
|
30
|
-
|
31
|
+
VanagonLogger.error "Could not find completion file for '#{shell}': No such file #{completion_file}"
|
31
32
|
exit 1
|
32
33
|
end
|
33
34
|
end
|
data/lib/vanagon/cli/inspect.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'docopt'
|
2
2
|
require 'json'
|
3
|
+
require 'vanagon/logger'
|
3
4
|
|
4
5
|
class Vanagon
|
5
6
|
class CLI
|
@@ -30,7 +31,7 @@ class Vanagon
|
|
30
31
|
def parse(argv)
|
31
32
|
Docopt.docopt(DOCUMENTATION, { argv: argv })
|
32
33
|
rescue Docopt::Exit => e
|
33
|
-
|
34
|
+
VanagonLogger.error e.message
|
34
35
|
exit 1
|
35
36
|
end
|
36
37
|
|
@@ -41,7 +42,7 @@ class Vanagon
|
|
41
42
|
platforms.each do |platform|
|
42
43
|
driver = Vanagon::Driver.new(platform, project, options)
|
43
44
|
components = driver.project.components.map(&:to_hash)
|
44
|
-
|
45
|
+
VanagonLogger.warn JSON.pretty_generate(components)
|
45
46
|
end
|
46
47
|
end
|
47
48
|
|
data/lib/vanagon/cli/list.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,6 +11,7 @@ class Vanagon
|
|
10
11
|
Options:
|
11
12
|
-h, --help Display help
|
12
13
|
-c, --configdir DIRECTORY Configuration directory [default: #{Dir.pwd}/configs]
|
14
|
+
-d, --defaults Display the list of default platforms
|
13
15
|
-l, --platforms Display a list of platforms
|
14
16
|
-r, --projects Display a list of projects
|
15
17
|
-s, --use-spaces Displays the list as space separated
|
@@ -18,7 +20,7 @@ class Vanagon
|
|
18
20
|
def parse(argv)
|
19
21
|
Docopt.docopt(DOCUMENTATION, { argv: argv })
|
20
22
|
rescue Docopt::Exit => e
|
21
|
-
|
23
|
+
VanagonLogger.error e.message
|
22
24
|
exit 1
|
23
25
|
end
|
24
26
|
|
@@ -31,10 +33,14 @@ class Vanagon
|
|
31
33
|
if Dir.exist?(File.join(options[:configdir], 'platforms')) == false ||
|
32
34
|
Dir.exist?(File.join(options[:configdir], 'projects')) == false
|
33
35
|
|
34
|
-
|
36
|
+
VanagonLogger.error "Path to #{File.join(options[:configdir], 'platforms')} or #{File.join(options[:configdir], 'projects')} not found."
|
35
37
|
exit 1
|
36
38
|
end
|
37
39
|
|
40
|
+
default_list = Dir.children(File.join(File.dirname(__FILE__), '..', 'platform', 'defaults')).map do |platform|
|
41
|
+
File.basename(platform, File.extname(platform))
|
42
|
+
end
|
43
|
+
|
38
44
|
platform_list = Dir.children(File.join(options[:configdir], 'platforms')).map do |platform|
|
39
45
|
File.basename(platform, File.extname(platform))
|
40
46
|
end
|
@@ -43,20 +49,23 @@ class Vanagon
|
|
43
49
|
File.basename(project, File.extname(project))
|
44
50
|
end
|
45
51
|
|
52
|
+
if options[:defaults]
|
53
|
+
puts "- Defaults", output(default_list, options[:use_spaces])
|
54
|
+
return
|
55
|
+
end
|
56
|
+
|
46
57
|
if options[:projects] == options[:platforms]
|
47
58
|
puts "- Projects", output(project_list, options[:use_spaces]), "\n", "- Platforms", output(platform_list, options[:use_spaces])
|
48
59
|
return
|
49
60
|
end
|
50
61
|
|
51
62
|
if options[:projects]
|
52
|
-
puts "- Projects"
|
53
|
-
puts output(project_list, options[:use_spaces])
|
63
|
+
puts "- Projects", output(project_list, options[:use_spaces])
|
54
64
|
return
|
55
65
|
end
|
56
66
|
|
57
67
|
if options[:platforms]
|
58
|
-
puts "- Platforms"
|
59
|
-
puts output(platform_list, options[:use_spaces])
|
68
|
+
puts "- Platforms", output(platform_list, options[:use_spaces])
|
60
69
|
return
|
61
70
|
end
|
62
71
|
end
|
@@ -64,6 +73,7 @@ class Vanagon
|
|
64
73
|
def options_translate(docopt_options)
|
65
74
|
translations = {
|
66
75
|
'--configdir' => :configdir,
|
76
|
+
'--defaults' => :defaults,
|
67
77
|
'--platforms' => :platforms,
|
68
78
|
'--projects' => :projects,
|
69
79
|
'--use-spaces' => :use_spaces,
|
data/lib/vanagon/cli/render.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'docopt'
|
2
2
|
require 'json'
|
3
|
+
require 'vanagon/logger'
|
3
4
|
|
4
5
|
class Vanagon
|
5
6
|
class CLI
|
@@ -27,7 +28,7 @@ class Vanagon
|
|
27
28
|
def parse(argv)
|
28
29
|
Docopt.docopt(DOCUMENTATION, { argv: argv })
|
29
30
|
rescue Docopt::Exit => e
|
30
|
-
|
31
|
+
VanagonLogger.error e.message
|
31
32
|
exit 1
|
32
33
|
end
|
33
34
|
|
data/lib/vanagon/cli/ship.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'docopt'
|
2
|
+
require 'vanagon/logger'
|
2
3
|
|
3
4
|
class Vanagon
|
4
5
|
class CLI
|
@@ -14,38 +15,22 @@ class Vanagon
|
|
14
15
|
def parse(argv)
|
15
16
|
Docopt.docopt(DOCUMENTATION, { argv: argv })
|
16
17
|
rescue Docopt::Exit => e
|
17
|
-
|
18
|
+
VanagonLogger.error e.message
|
18
19
|
exit 1
|
19
20
|
end
|
20
21
|
|
21
22
|
def run(_)
|
22
23
|
ENV['PROJECT_ROOT'] = Dir.pwd
|
23
24
|
|
24
|
-
artifactory_warning = <<-DOC
|
25
|
-
Unable to ship packages to artifactory. Please make sure you are pointing to a
|
26
|
-
recent version of packaging in your Gemfile. Please also make sure you include
|
27
|
-
the artifactory gem in your Gemfile.
|
28
|
-
|
29
|
-
Examples:
|
30
|
-
gem 'packaging', :github => 'puppetlabs/packaging', branch: '1.0.x'
|
31
|
-
gem 'artifactory'
|
32
|
-
DOC
|
33
|
-
|
34
25
|
if Dir['output/**/*'].select { |entry| File.file?(entry) }.empty?
|
35
|
-
|
26
|
+
VanagonLogger.error 'vanagon: Error: No packages to ship in the "output" directory. Maybe build some first?'
|
36
27
|
exit 1
|
37
28
|
end
|
38
29
|
|
39
30
|
require 'packaging'
|
40
31
|
Pkg::Util::RakeUtils.load_packaging_tasks
|
41
32
|
Pkg::Util::RakeUtils.invoke_task('pl:jenkins:ship', 'artifacts', 'output')
|
42
|
-
|
43
|
-
Pkg::Util::RakeUtils.invoke_task('pl:jenkins:ship_to_artifactory', 'output')
|
44
|
-
rescue LoadError
|
45
|
-
warn artifactory_warning
|
46
|
-
rescue StandardError
|
47
|
-
warn artifactory_warning
|
48
|
-
end
|
33
|
+
Pkg::Util::RakeUtils.invoke_task('pl:jenkins:ship_to_artifactory', 'output')
|
49
34
|
end
|
50
35
|
end
|
51
36
|
end
|
data/lib/vanagon/cli/sign.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'docopt'
|
2
|
+
require 'vanagon/logger'
|
2
3
|
|
3
4
|
class Vanagon
|
4
5
|
class CLI
|
@@ -14,14 +15,14 @@ class Vanagon
|
|
14
15
|
def parse(argv)
|
15
16
|
Docopt.docopt(DOCUMENTATION, { argv: argv })
|
16
17
|
rescue Docopt::Exit => e
|
17
|
-
|
18
|
+
VanagonLogger.error e.message
|
18
19
|
exit 1
|
19
20
|
end
|
20
21
|
|
21
22
|
def run(_)
|
22
23
|
ENV['PROJECT_ROOT'] = Dir.pwd
|
23
24
|
if Dir['output/**/*'].select { |entry| File.file?(entry) }.empty?
|
24
|
-
|
25
|
+
VanagonLogger.error 'sign: Error: No packages to sign in the "output" directory. Maybe build some first?'
|
25
26
|
exit 1
|
26
27
|
end
|
27
28
|
|
data/lib/vanagon/component.rb
CHANGED
@@ -3,6 +3,8 @@ require 'vanagon/component/rules'
|
|
3
3
|
require 'vanagon/component/source'
|
4
4
|
require 'vanagon/component/source/rewrite'
|
5
5
|
|
6
|
+
require 'vanagon/logger'
|
7
|
+
|
6
8
|
class Vanagon
|
7
9
|
class Component
|
8
10
|
include Vanagon::Utilities
|
@@ -138,9 +140,9 @@ class Vanagon
|
|
138
140
|
dsl.instance_eval(File.read(compfile), compfile, 1)
|
139
141
|
dsl._component
|
140
142
|
rescue StandardError => e
|
141
|
-
|
142
|
-
|
143
|
-
|
143
|
+
VanagonLogger.error "Error loading project '#{name}' using '#{compfile}':"
|
144
|
+
VanagonLogger.error e
|
145
|
+
VanagonLogger.error e.backtrace.join("\n")
|
144
146
|
raise e
|
145
147
|
end
|
146
148
|
|
@@ -178,6 +180,7 @@ class Vanagon
|
|
178
180
|
@preremove_actions = []
|
179
181
|
@postremove_actions = []
|
180
182
|
@install_only = false
|
183
|
+
@service = []
|
181
184
|
end
|
182
185
|
|
183
186
|
# Adds the given file to the list of files and returns @files.
|
@@ -254,18 +257,18 @@ class Vanagon
|
|
254
257
|
def fetch_mirrors(options)
|
255
258
|
mirrors.to_a.shuffle.each do |mirror|
|
256
259
|
begin
|
257
|
-
|
260
|
+
VanagonLogger.info %(Attempting to fetch from mirror URL "#{mirror}")
|
258
261
|
@source = Vanagon::Component::Source.source(mirror, options)
|
259
262
|
return true if source.fetch
|
260
263
|
rescue SocketError
|
261
264
|
# SocketError means that there was no DNS/name resolution
|
262
265
|
# for whatever remote protocol the mirror tried to use.
|
263
|
-
|
266
|
+
VanagonLogger.error %(Unable to resolve mirror URL "#{mirror}")
|
264
267
|
rescue RuntimeError
|
265
268
|
# Source retrieval does not consistently return a meaningful
|
266
269
|
# namespaced error message, which means we're brute-force rescuing
|
267
270
|
# RuntimeError. Not a good look, and we should fix this.
|
268
|
-
|
271
|
+
VanagonLogger.error %(Unable to retrieve mirror URL "#{mirror}")
|
269
272
|
end
|
270
273
|
end
|
271
274
|
false
|
@@ -277,7 +280,7 @@ class Vanagon
|
|
277
280
|
# @return [Boolean] return True if the source can be retrieved,
|
278
281
|
# or False otherwise
|
279
282
|
def fetch_url(options)
|
280
|
-
|
283
|
+
VanagonLogger.info %(Attempting to fetch from canonical URL "#{url}")
|
281
284
|
@source = Vanagon::Component::Source.source(url, options)
|
282
285
|
# Explicitly coerce the return value of #source.fetch,
|
283
286
|
# because each subclass of Vanagon::Component::Source returns
|
@@ -303,7 +306,7 @@ class Vanagon
|
|
303
306
|
def get_source(workdir) # rubocop:disable Metrics/AbcSize, Metrics/PerceivedComplexity
|
304
307
|
opts = options.merge({ workdir: workdir })
|
305
308
|
if url || !mirrors.empty?
|
306
|
-
if ENV['VANAGON_USE_MIRRORS'] == 'n'
|
309
|
+
if ENV['VANAGON_USE_MIRRORS'] == 'n' or ENV['VANAGON_USE_MIRRORS'] == 'false'
|
307
310
|
fetch_url(opts)
|
308
311
|
else
|
309
312
|
fetch_mirrors(opts) || fetch_url(opts)
|
@@ -319,7 +322,7 @@ class Vanagon
|
|
319
322
|
@version ||= source.version
|
320
323
|
end
|
321
324
|
else
|
322
|
-
|
325
|
+
VanagonLogger.info "No source given for component '#{@name}'"
|
323
326
|
|
324
327
|
# If there is no source, we don't want to try to change directories, so we just change to the current directory.
|
325
328
|
@dirname = './'
|
@@ -407,7 +410,7 @@ class Vanagon
|
|
407
410
|
# @return [String] environment suitable for inclusion in a Makefile
|
408
411
|
# @deprecated
|
409
412
|
def get_environment
|
410
|
-
|
413
|
+
VanagonLogger.info <<-WARNING.undent
|
411
414
|
#get_environment is deprecated; environment variables have been moved
|
412
415
|
into the Makefile, and should not be used within a Makefile's recipe.
|
413
416
|
The #get_environment method will be removed by Vanagon 1.0.0.
|