vanagon 0.21.1 → 0.22.0
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/README.md +7 -0
- data/lib/vanagon/engine/pooler.rb +4 -1
- data/lib/vanagon/platform/defaults/debian-11-amd64.rb +11 -0
- data/lib/vanagon/platform/osx.rb +1 -0
- data/lib/vanagon/utilities/extra_files_signer.rb +5 -2
- data/spec/lib/vanagon/utilities/extra_files_signer_spec.rb +45 -12
- metadata +31 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1cd74e5ec690b73ee51e201f896f81a448020c90509107ec229c603b19b578bb
|
4
|
+
data.tar.gz: 9584067cc8334e4b280f7105834ffa7efe08d62e5b418f89cc53ee90c6f436f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1637ab1e2874427d490551f7e166a6607aadf6fa4c452697d4eb857bd5735369ad3977f6e53efc1e6b99c3bbda6bb5a0422be4366ccebeab00eda49805a93d05
|
7
|
+
data.tar.gz: 2e476edabd0575c234b2b94a23947b2d0c9c5dced079648deea0a014e98b15bd69bee833e02d234ab11eb6949323ac4f9aa7743fcc07918ed8ef5833070de546
|
data/README.md
CHANGED
@@ -230,6 +230,13 @@ time. The default value is *7200* seconds(120 minutes) but setting to any
|
|
230
230
|
integer value these components to fail after the `VANAGON_TIMEOUT` count is reached.
|
231
231
|
Note that this value is expected to be in seconds.
|
232
232
|
|
233
|
+
##### `VANAGON_FORCE_SIGNING`
|
234
|
+
By default, Vanagon does not fail if extra files signing fails, it just logs an
|
235
|
+
error and continues building the package. This is unwanted behavior in
|
236
|
+
environments where we expect a hard failure when signing cannot proceed. To
|
237
|
+
force Vanagon to fail if extra files signing fails, ensure this variable is set
|
238
|
+
before starting a build.
|
239
|
+
|
233
240
|
#### Example usage
|
234
241
|
`vanagon build --preserve puppet-agent el-6-i386` will build the puppet-agent project
|
235
242
|
on the el-6-i386 platform and leave the host intact afterward.
|
@@ -15,7 +15,10 @@ class Vanagon
|
|
15
15
|
def initialize(platform, target = nil, **opts)
|
16
16
|
super
|
17
17
|
|
18
|
-
@available_poolers = [
|
18
|
+
@available_poolers = %w[
|
19
|
+
https://vmpooler.delivery.puppetlabs.net
|
20
|
+
https://nspooler-prod.k8s.infracore.puppet.net
|
21
|
+
]
|
19
22
|
@token = load_token
|
20
23
|
@required_attributes << "vmpooler_template"
|
21
24
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
platform "debian-11-amd64" do |plat|
|
2
|
+
plat.servicedir "/lib/systemd/system"
|
3
|
+
plat.defaultdir "/etc/default"
|
4
|
+
plat.servicetype "systemd"
|
5
|
+
plat.codename "bullseye"
|
6
|
+
|
7
|
+
packages = %w(build-essential devscripts make quilt pkg-config debhelper rsync fakeroot cmake)
|
8
|
+
plat.provision_with "export DEBIAN_FRONTEND=noninteractive; apt-get update -qq; apt-get install -qy --no-install-recommends #{packages.join(' ')}"
|
9
|
+
plat.install_build_dependencies_with "DEBIAN_FRONTEND=noninteractive; apt-get install -qy --no-install-recommends "
|
10
|
+
plat.vmpooler_template "debian-11-x86_64"
|
11
|
+
end
|
data/lib/vanagon/platform/osx.rb
CHANGED
@@ -64,6 +64,7 @@ class Vanagon
|
|
64
64
|
--scripts $(tempdir)/osx/build/scripts \
|
65
65
|
--identifier #{project.identifier}.#{project.name} \
|
66
66
|
--version #{project.version} \
|
67
|
+
--preserve-xattr \
|
67
68
|
--install-location / \
|
68
69
|
payload/#{project.name}-#{project.version}-#{project.release}.pkg)",
|
69
70
|
# Create a custom installer using the pkg above
|
@@ -19,11 +19,13 @@ class Vanagon
|
|
19
19
|
remote_host = "#{project.signing_username}@#{project.signing_hostname}"
|
20
20
|
remote_destination_path = "#{remote_host}:#{tempdir}"
|
21
21
|
remote_file_location = "#{remote_host}:#{file_location}"
|
22
|
+
extra_flags = ''
|
23
|
+
extra_flags = '--extended-attributes' if project.platform.is_macos?
|
22
24
|
|
23
25
|
commands += [
|
24
|
-
"rsync -e '#{Vanagon::Utilities.ssh_command}' --verbose --recursive --hard-links --links --no-perms --no-owner --no-group #{local_source_path} #{remote_destination_path}",
|
26
|
+
"rsync -e '#{Vanagon::Utilities.ssh_command}' --verbose --recursive --hard-links --links --no-perms --no-owner --no-group #{extra_flags} #{local_source_path} #{remote_destination_path}",
|
25
27
|
"#{Vanagon::Utilities.ssh_command} #{remote_host} #{project.signing_command} #{file_location}",
|
26
|
-
"rsync -e '#{Vanagon::Utilities.ssh_command}' --verbose --recursive --hard-links --links --no-perms --no-owner --no-group #{remote_file_location} #{local_source_path}"
|
28
|
+
"rsync -e '#{Vanagon::Utilities.ssh_command}' --verbose --recursive --hard-links --links --no-perms --no-owner --no-group #{extra_flags} #{remote_file_location} #{local_source_path}"
|
27
29
|
]
|
28
30
|
end
|
29
31
|
|
@@ -31,6 +33,7 @@ class Vanagon
|
|
31
33
|
rescue RuntimeError
|
32
34
|
require 'vanagon/logger'
|
33
35
|
VanagonLogger.error "Unable to connect to #{project.signing_username}@#{project.signing_hostname}, skipping signing extra files: #{project.extra_files_to_sign.join(',')}"
|
36
|
+
raise if ENV['VANAGON_FORCE_SIGNING']
|
34
37
|
[]
|
35
38
|
end
|
36
39
|
end
|
@@ -68,21 +68,54 @@ describe Vanagon::Utilities::ExtraFilesSigner do
|
|
68
68
|
Vanagon::Utilities::ExtraFilesSigner.commands(project._project, mktemp, source_dir)
|
69
69
|
expect(VanagonLogger).to have_received(:error).with(/Unable to connect to test@abc/)
|
70
70
|
end
|
71
|
+
|
72
|
+
it 'fails the build if VANAGON_FORCE_SIGNING is set' do
|
73
|
+
allow(ENV).to receive(:[]).with('VANAGON_FORCE_SIGNING').and_return('true')
|
74
|
+
expect {
|
75
|
+
Vanagon::Utilities::ExtraFilesSigner.commands(project._project, mktemp, source_dir)
|
76
|
+
}.to raise_error(RuntimeError)
|
77
|
+
end
|
71
78
|
end
|
72
79
|
|
73
80
|
context 'when success' do
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
81
|
+
context 'when macos' do
|
82
|
+
it 'generates signing commands for each file using --extended-attributes' do
|
83
|
+
commands = Vanagon::Utilities::ExtraFilesSigner.commands(project._project, mktemp, source_dir)
|
84
|
+
expect(commands).to match(
|
85
|
+
[
|
86
|
+
"rsync -e '/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' --verbose --recursive --hard-links --links --no-perms --no-owner --no-group --extended-attributes $(tempdir)/dir/source_dir/test1/a.rb test@abc:/tmp/xyz",
|
87
|
+
"/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no test@abc codesign /tmp/xyz/a.rb",
|
88
|
+
"rsync -e '/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' --verbose --recursive --hard-links --links --no-perms --no-owner --no-group --extended-attributes test@abc:/tmp/xyz/a.rb $(tempdir)/dir/source_dir/test1/a.rb",
|
89
|
+
"rsync -e '/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' --verbose --recursive --hard-links --links --no-perms --no-owner --no-group --extended-attributes $(tempdir)/dir/source_dir/test2/b.rb test@abc:/tmp/xyz",
|
90
|
+
"/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no test@abc codesign /tmp/xyz/b.rb",
|
91
|
+
"rsync -e '/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' --verbose --recursive --hard-links --links --no-perms --no-owner --no-group --extended-attributes test@abc:/tmp/xyz/b.rb $(tempdir)/dir/source_dir/test2/b.rb"
|
92
|
+
]
|
93
|
+
)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
context 'when other platform' do
|
98
|
+
let(:platform_block) do
|
99
|
+
%( platform "windows-2012r2-x86_64" do |plat|
|
100
|
+
end
|
101
|
+
)
|
102
|
+
end
|
103
|
+
|
104
|
+
let(:platform) { Vanagon::Platform::DSL.new('windows-2012r2-x86_64') }
|
105
|
+
|
106
|
+
it 'generates signing commands for each file' do
|
107
|
+
commands = Vanagon::Utilities::ExtraFilesSigner.commands(project._project, mktemp, source_dir)
|
108
|
+
expect(commands).to match(
|
109
|
+
[
|
110
|
+
"rsync -e '/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' --verbose --recursive --hard-links --links --no-perms --no-owner --no-group $(tempdir)/dir/source_dir/test1/a.rb test@abc:/tmp/xyz",
|
111
|
+
"/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no test@abc codesign /tmp/xyz/a.rb",
|
112
|
+
"rsync -e '/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' --verbose --recursive --hard-links --links --no-perms --no-owner --no-group test@abc:/tmp/xyz/a.rb $(tempdir)/dir/source_dir/test1/a.rb",
|
113
|
+
"rsync -e '/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' --verbose --recursive --hard-links --links --no-perms --no-owner --no-group $(tempdir)/dir/source_dir/test2/b.rb test@abc:/tmp/xyz",
|
114
|
+
"/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no test@abc codesign /tmp/xyz/b.rb",
|
115
|
+
"rsync -e '/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' --verbose --recursive --hard-links --links --no-perms --no-owner --no-group test@abc:/tmp/xyz/b.rb $(tempdir)/dir/source_dir/test2/b.rb"
|
116
|
+
]
|
117
|
+
)
|
118
|
+
end
|
86
119
|
end
|
87
120
|
end
|
88
121
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vanagon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.22.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet Labs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: docopt
|
@@ -153,6 +153,7 @@ files:
|
|
153
153
|
- lib/vanagon/platform.rb
|
154
154
|
- lib/vanagon/platform/deb.rb
|
155
155
|
- lib/vanagon/platform/defaults/debian-10-amd64.rb
|
156
|
+
- lib/vanagon/platform/defaults/debian-11-amd64.rb
|
156
157
|
- lib/vanagon/platform/defaults/debian-8-amd64.rb
|
157
158
|
- lib/vanagon/platform/defaults/debian-8-i386.rb
|
158
159
|
- lib/vanagon/platform/defaults/debian-9-amd64.rb
|
@@ -323,42 +324,42 @@ signing_key:
|
|
323
324
|
specification_version: 3
|
324
325
|
summary: All of your packages will fit into this van with this one simple trick.
|
325
326
|
test_files:
|
327
|
+
- spec/lib/makefile_spec.rb
|
326
328
|
- spec/lib/git/rev_list_spec.rb
|
327
|
-
- spec/lib/vanagon/engine/always_be_scheduling_spec.rb
|
328
|
-
- spec/lib/vanagon/engine/base_spec.rb
|
329
|
-
- spec/lib/vanagon/engine/docker_spec.rb
|
330
|
-
- spec/lib/vanagon/engine/pooler_spec.rb
|
331
|
-
- spec/lib/vanagon/engine/local_spec.rb
|
332
|
-
- spec/lib/vanagon/engine/hardware_spec.rb
|
333
|
-
- spec/lib/vanagon/engine/ec2_spec.rb
|
334
|
-
- spec/lib/vanagon/cli_spec.rb
|
335
|
-
- spec/lib/vanagon/project/dsl_spec.rb
|
336
329
|
- spec/lib/vanagon/utilities/shell_utilities_spec.rb
|
337
330
|
- spec/lib/vanagon/utilities/extra_files_signer_spec.rb
|
338
|
-
- spec/lib/vanagon/component_spec.rb
|
339
|
-
- spec/lib/vanagon/platform_spec.rb
|
340
|
-
- spec/lib/vanagon/driver_spec.rb
|
341
|
-
- spec/lib/vanagon/component/rules_spec.rb
|
342
|
-
- spec/lib/vanagon/component/source/local_spec.rb
|
343
|
-
- spec/lib/vanagon/component/source/rewrite_spec.rb
|
344
|
-
- spec/lib/vanagon/component/source/http_spec.rb
|
345
|
-
- spec/lib/vanagon/component/source/git_spec.rb
|
346
|
-
- spec/lib/vanagon/component/source_spec.rb
|
347
|
-
- spec/lib/vanagon/component/dsl_spec.rb
|
348
|
-
- spec/lib/vanagon/project_spec.rb
|
349
331
|
- spec/lib/vanagon/common/pathname_spec.rb
|
350
332
|
- spec/lib/vanagon/common/user_spec.rb
|
351
333
|
- spec/lib/vanagon/environment_spec.rb
|
352
|
-
- spec/lib/vanagon/extensions/set/json_spec.rb
|
353
|
-
- spec/lib/vanagon/extensions/string_spec.rb
|
354
|
-
- spec/lib/vanagon/extensions/ostruct/json_spec.rb
|
355
|
-
- spec/lib/vanagon/platform/rpm_spec.rb
|
356
334
|
- spec/lib/vanagon/platform/windows_spec.rb
|
357
335
|
- spec/lib/vanagon/platform/deb_spec.rb
|
358
|
-
- spec/lib/vanagon/platform/dsl_spec.rb
|
359
|
-
- spec/lib/vanagon/platform/rpm/aix_spec.rb
|
360
336
|
- spec/lib/vanagon/platform/solaris_11_spec.rb
|
361
|
-
- spec/lib/vanagon/platform/
|
337
|
+
- spec/lib/vanagon/platform/rpm_spec.rb
|
362
338
|
- spec/lib/vanagon/platform/solaris_10_spec.rb
|
339
|
+
- spec/lib/vanagon/platform/rpm/aix_spec.rb
|
340
|
+
- spec/lib/vanagon/platform/osx_spec.rb
|
341
|
+
- spec/lib/vanagon/platform/dsl_spec.rb
|
342
|
+
- spec/lib/vanagon/component_spec.rb
|
363
343
|
- spec/lib/vanagon/utilities_spec.rb
|
364
|
-
- spec/lib/
|
344
|
+
- spec/lib/vanagon/project_spec.rb
|
345
|
+
- spec/lib/vanagon/cli_spec.rb
|
346
|
+
- spec/lib/vanagon/extensions/ostruct/json_spec.rb
|
347
|
+
- spec/lib/vanagon/extensions/string_spec.rb
|
348
|
+
- spec/lib/vanagon/extensions/set/json_spec.rb
|
349
|
+
- spec/lib/vanagon/project/dsl_spec.rb
|
350
|
+
- spec/lib/vanagon/platform_spec.rb
|
351
|
+
- spec/lib/vanagon/engine/ec2_spec.rb
|
352
|
+
- spec/lib/vanagon/engine/docker_spec.rb
|
353
|
+
- spec/lib/vanagon/engine/hardware_spec.rb
|
354
|
+
- spec/lib/vanagon/engine/local_spec.rb
|
355
|
+
- spec/lib/vanagon/engine/always_be_scheduling_spec.rb
|
356
|
+
- spec/lib/vanagon/engine/pooler_spec.rb
|
357
|
+
- spec/lib/vanagon/engine/base_spec.rb
|
358
|
+
- spec/lib/vanagon/component/source/rewrite_spec.rb
|
359
|
+
- spec/lib/vanagon/component/source/local_spec.rb
|
360
|
+
- spec/lib/vanagon/component/source/http_spec.rb
|
361
|
+
- spec/lib/vanagon/component/source/git_spec.rb
|
362
|
+
- spec/lib/vanagon/component/rules_spec.rb
|
363
|
+
- spec/lib/vanagon/component/dsl_spec.rb
|
364
|
+
- spec/lib/vanagon/component/source_spec.rb
|
365
|
+
- spec/lib/vanagon/driver_spec.rb
|