vanagon 0.25.0 → 0.26.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: 5c5942e2eb5cb60b0d61c7bb691fd41796d06a34f6ab4ad6558d12e2b368f04c
4
- data.tar.gz: 2c169e9c4fa08538310e90e18dc4336ecd98596f6b6b47a8c86efe20c0bc5a16
3
+ metadata.gz: a9b054ba055927fcdbc69228b433ec3c01e52841c4fd93841394d3ab371bcb0e
4
+ data.tar.gz: 787e12bc102de7ab7a16b7b0f9a0f9fbff4f60fece396fdcc3a9b752f8c933aa
5
5
  SHA512:
6
- metadata.gz: ca9a2db8658afe0d71ac7300e07edb6f6b874c0e8ff753f03536da144b8070ac41f7389eaacf1067e1f0ab0937a253fc88f1e3011b2383dbba7acb3056233020
7
- data.tar.gz: 67f11f91d870a2fce2890a5115947729b4f590c581932a71317ac936de74826ecc3f7a213540b34e34f71e51e075bb127421e2e8a1aa778bb6748046a702521a
6
+ metadata.gz: e0220c7ab2bd7f07945dc0d313976693616ac8ef99103d526da8a89b85c21f8089ed54117a6df5201ca7cb17b40fa6f8c32e8ed359a1da0e75afc831e961860c
7
+ data.tar.gz: b460870be764e84925886041b21bc017fa3016575c57a005bfd482ec7242abf668f0e03b2fe7e243f42ae5d3612f99b4fb177322eed0845033eb2a99cec0f6e7
@@ -36,7 +36,7 @@ module BasicSubmodules
36
36
  # @option options [Boolean] :recursive recurse into nested submodules
37
37
  # @return options [String] any output produced by `git` when submodules are initialized
38
38
  def update_submodules(**options)
39
- self.lib.update_submodules(options)
39
+ self.lib.update_submodules(**options)
40
40
  end
41
41
  end
42
42
 
@@ -50,7 +50,7 @@ class Vanagon
50
50
 
51
51
  def valid_remote?(url, timeout = 0)
52
52
  Timeout.timeout(timeout) do
53
- Vanagon::Utilities.local_command("git ls-remote #{url} > /dev/null 2>&1")
53
+ Vanagon::Utilities.local_command("git ls-remote --heads #{url} > /dev/null 2>&1")
54
54
  return false unless $?.exitstatus.zero?
55
55
  return true
56
56
  end
@@ -258,7 +258,7 @@ class Vanagon
258
258
  mirrors.to_a.shuffle.each do |mirror|
259
259
  begin
260
260
  VanagonLogger.info %(Attempting to fetch from mirror URL "#{mirror}")
261
- @source = Vanagon::Component::Source.source(mirror, options)
261
+ @source = Vanagon::Component::Source.source(mirror, **options)
262
262
  return true if source.fetch
263
263
  rescue SocketError
264
264
  # SocketError means that there was no DNS/name resolution
@@ -281,7 +281,7 @@ class Vanagon
281
281
  # or False otherwise
282
282
  def fetch_url(options)
283
283
  VanagonLogger.info %(Attempting to fetch from canonical URL "#{url}")
284
- @source = Vanagon::Component::Source.source(url, options)
284
+ @source = Vanagon::Component::Source.source(url, **options)
285
285
  # Explicitly coerce the return value of #source.fetch,
286
286
  # because each subclass of Vanagon::Component::Source returns
287
287
  # an inconsistent value if #fetch is successful.
@@ -41,6 +41,8 @@ class Vanagon
41
41
  sign_commands = []
42
42
  end
43
43
 
44
+ signing_host = "jenkins@osx-signer-prod-2.delivery.puppetlabs.net"
45
+
44
46
  # Setup build directories
45
47
  ["bash -c 'mkdir -p $(tempdir)/osx/build/{dmg,pkg,scripts,resources,root,payload,plugins}'",
46
48
  "mkdir -p $(tempdir)/osx/build/root/#{project.name}-#{project.version}",
@@ -56,8 +58,26 @@ class Vanagon
56
58
 
57
59
  bom_install,
58
60
 
61
+ # The signing commands below should not cause `vanagon build` to fail. Many devs need to run `vanagon build`
62
+ # locally and do not necessarily need signed packages. The `|| :` will rescue failures by evaluating as successful.
63
+ # /Users/binaries will be a list of all binaries that need to be signed
64
+ "touch /Users/binaries || :",
65
+ # Find all of the executables (Mach-O files), and put the in /Users/binaries
66
+ "for item in `find $(tempdir)/osx/build/ -perm -0100 -type f` ; do file $$item | grep 'Mach-O' ; done | awk '{print $$1}' | sed 's/\:$$//' > /Users/binaries || :",
67
+ # A tmpdir is created on the signing_host, all of the executables will be rsyncd there to be signed
68
+ "#{Vanagon::Utilities.ssh_command} #{signing_host} mkdir -p /tmp/$(binaries_dir) || :",
69
+ "rsync -e '#{Vanagon::Utilities.ssh_command}' --no-perms --no-owner --no-group --files-from=/Users/binaries / #{signing_host}:/tmp/$(binaries_dir) || :",
70
+ "rsync -e '#{Vanagon::Utilities.ssh_command}' --no-perms --no-owner --no-group /Users/binaries #{signing_host}:/tmp/$(binaries_dir)/binaries_list || :",
71
+ # The binaries are signed, and then rsynced back
72
+ "#{Vanagon::Utilities.ssh_command} #{signing_host} /usr/local/bin/sign.sh $(binaries_dir) || :",
73
+ "rsync -e '#{Vanagon::Utilities.ssh_command}' --no-perms --no-owner --no-group -r #{signing_host}:/tmp/$(binaries_dir)/var/ /var || :",
74
+
59
75
  # Sign extra files
60
76
  sign_commands,
77
+ # Some extra files are created during the signing process that are not needed, so we delete them! Otherwise
78
+ # notarization gets confused by these extra files.
79
+ "for item in `find $(tempdir)/osx/build -type d -name Resources` ; do rm -rf $$item ; done || :",
80
+
61
81
 
62
82
  # Package the project
63
83
  "(cd $(tempdir)/osx/build/; #{@pkgbuild} --root root/#{project.name}-#{project.version} \
@@ -9,6 +9,10 @@ workdir := $(PWD)
9
9
 
10
10
  all: file-list-before-build <%= package_name %>
11
11
 
12
+ <%- if @platform.is_macos? -%>
13
+ binaries_dir := $(shell <%= @platform.mktemp %> 2>/dev/null)
14
+ <%- end -%>
15
+
12
16
  <%= package_name %>: <%= @name %>-<%= @version %>.tar.gz
13
17
  <%= generate_package.join("\n\t") %>
14
18
 
@@ -1,5 +1,4 @@
1
- begin
2
- require 'aws-sdk'
1
+ begin require 'aws-sdk'
3
2
  rescue LoadError
4
3
  $stderr.puts "Unable to load AWS SDK; skipping optional EC2 engine spec tests"
5
4
  end
@@ -28,7 +27,10 @@ if defined? ::Aws
28
27
 
29
28
  it 'returns "ec2" name' do
30
29
  stub_request(:get, "http://169.254.169.254/latest/meta-data/iam/security-credentials/").
30
+ to_return(status: 200, body: "", headers: {})
31
+ stub_request(:put, "http://169.254.169.254/latest/api/token").
31
32
  to_return(status: 200, body: "", headers: {})
33
+
32
34
  expect(Vanagon::Engine::Ec2.new(platform_ec2).name).to eq('ec2')
33
35
  end
34
36
  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.25.0
4
+ version: 0.26.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: 2022-01-24 00:00:00.000000000 Z
11
+ date: 2022-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docopt
@@ -312,9 +312,12 @@ require_paths:
312
312
  - lib
313
313
  required_ruby_version: !ruby/object:Gem::Requirement
314
314
  requirements:
315
- - - "~>"
315
+ - - ">="
316
316
  - !ruby/object:Gem::Version
317
317
  version: '2.3'
318
+ - - "<"
319
+ - !ruby/object:Gem::Version
320
+ version: '4'
318
321
  required_rubygems_version: !ruby/object:Gem::Requirement
319
322
  requirements:
320
323
  - - ">="
@@ -327,41 +330,41 @@ specification_version: 3
327
330
  summary: All of your packages will fit into this van with this one simple trick.
328
331
  test_files:
329
332
  - spec/lib/makefile_spec.rb
333
+ - spec/lib/vanagon/common/user_spec.rb
334
+ - spec/lib/vanagon/common/pathname_spec.rb
335
+ - spec/lib/vanagon/utilities_spec.rb
336
+ - spec/lib/vanagon/project_spec.rb
330
337
  - spec/lib/vanagon/utilities/shell_utilities_spec.rb
331
338
  - spec/lib/vanagon/utilities/extra_files_signer_spec.rb
332
- - spec/lib/vanagon/project_spec.rb
333
- - spec/lib/vanagon/component_spec.rb
334
- - spec/lib/vanagon/extensions/set/json_spec.rb
335
- - spec/lib/vanagon/extensions/ostruct/json_spec.rb
336
- - spec/lib/vanagon/extensions/string_spec.rb
337
- - spec/lib/vanagon/component/source/local_spec.rb
338
- - spec/lib/vanagon/component/source/rewrite_spec.rb
339
- - spec/lib/vanagon/component/source/http_spec.rb
340
- - spec/lib/vanagon/component/source/git_spec.rb
341
- - spec/lib/vanagon/component/source_spec.rb
342
- - spec/lib/vanagon/component/dsl_spec.rb
343
- - spec/lib/vanagon/component/rules_spec.rb
344
- - spec/lib/vanagon/driver_spec.rb
345
- - spec/lib/vanagon/utilities_spec.rb
346
339
  - spec/lib/vanagon/cli_spec.rb
347
- - spec/lib/vanagon/common/pathname_spec.rb
348
- - spec/lib/vanagon/common/user_spec.rb
349
- - spec/lib/vanagon/engine/local_spec.rb
340
+ - spec/lib/vanagon/driver_spec.rb
350
341
  - spec/lib/vanagon/engine/base_spec.rb
351
- - spec/lib/vanagon/engine/docker_spec.rb
352
- - spec/lib/vanagon/engine/always_be_scheduling_spec.rb
342
+ - spec/lib/vanagon/engine/local_spec.rb
353
343
  - spec/lib/vanagon/engine/hardware_spec.rb
354
- - spec/lib/vanagon/engine/pooler_spec.rb
355
344
  - spec/lib/vanagon/engine/ec2_spec.rb
356
- - spec/lib/vanagon/platform_spec.rb
357
- - spec/lib/vanagon/environment_spec.rb
358
- - spec/lib/vanagon/platform/solaris_10_spec.rb
359
- - spec/lib/vanagon/platform/windows_spec.rb
345
+ - spec/lib/vanagon/engine/always_be_scheduling_spec.rb
346
+ - spec/lib/vanagon/engine/pooler_spec.rb
347
+ - spec/lib/vanagon/engine/docker_spec.rb
348
+ - spec/lib/vanagon/project/dsl_spec.rb
349
+ - spec/lib/vanagon/component_spec.rb
350
+ - spec/lib/vanagon/extensions/ostruct/json_spec.rb
351
+ - spec/lib/vanagon/extensions/string_spec.rb
352
+ - spec/lib/vanagon/extensions/set/json_spec.rb
353
+ - spec/lib/vanagon/platform/solaris_11_spec.rb
360
354
  - spec/lib/vanagon/platform/rpm_spec.rb
355
+ - spec/lib/vanagon/platform/solaris_10_spec.rb
356
+ - spec/lib/vanagon/platform/dsl_spec.rb
361
357
  - spec/lib/vanagon/platform/rpm/aix_spec.rb
362
- - spec/lib/vanagon/platform/solaris_11_spec.rb
358
+ - spec/lib/vanagon/platform/windows_spec.rb
363
359
  - spec/lib/vanagon/platform/deb_spec.rb
364
- - spec/lib/vanagon/platform/dsl_spec.rb
365
360
  - spec/lib/vanagon/platform/osx_spec.rb
366
- - spec/lib/vanagon/project/dsl_spec.rb
361
+ - spec/lib/vanagon/environment_spec.rb
362
+ - spec/lib/vanagon/platform_spec.rb
363
+ - spec/lib/vanagon/component/source_spec.rb
364
+ - spec/lib/vanagon/component/rules_spec.rb
365
+ - spec/lib/vanagon/component/source/local_spec.rb
366
+ - spec/lib/vanagon/component/source/git_spec.rb
367
+ - spec/lib/vanagon/component/source/http_spec.rb
368
+ - spec/lib/vanagon/component/source/rewrite_spec.rb
369
+ - spec/lib/vanagon/component/dsl_spec.rb
367
370
  - spec/lib/git/rev_list_spec.rb