vanagon 0.21.1 → 0.22.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5594ace45005baef8cc8dda25c0fa7c59f8bee3bd8224709d2dfbc0d8dfbbf5b
4
- data.tar.gz: 6f5ccee0dd9713e2177dea361ffe93f65ac15d9ed69e30262a8b962efef67907
3
+ metadata.gz: 1cd74e5ec690b73ee51e201f896f81a448020c90509107ec229c603b19b578bb
4
+ data.tar.gz: 9584067cc8334e4b280f7105834ffa7efe08d62e5b418f89cc53ee90c6f436f6
5
5
  SHA512:
6
- metadata.gz: f1fe1c250db472eaab9bd44c537a770c71a17313d5579a9dd198f9c585ffd281a921eadac4023debef2e96b0b66a280ef339ce9d0d58921cc4a18545a36c863f
7
- data.tar.gz: b38c3ab64b33243ffbed532e48d0566a8f596f2c9bb8704789f4fe3398fd79fcc4a6c405dcaad0ec3edde0d6bdb9101eee68cf1a35f6a985b91543febe33f94e
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 = ["https://vmpooler.delivery.puppetlabs.net", "https://nspooler-service-prod-1.delivery.puppetlabs.net"]
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
@@ -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
- it 'generates signing commands for each file' do
75
- commands = Vanagon::Utilities::ExtraFilesSigner.commands(project._project, mktemp, source_dir)
76
- expect(commands).to match(
77
- [
78
- "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",
79
- "/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no test@abc codesign /tmp/xyz/a.rb",
80
- "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",
81
- "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",
82
- "/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no test@abc codesign /tmp/xyz/b.rb",
83
- "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"
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.21.1
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-06-07 00:00:00.000000000 Z
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/osx_spec.rb
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/makefile_spec.rb
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