vanagon 0.31.0 → 0.32.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: bda77708ce132b1087ddce71cffc9235971f7e14777e2f76094c39ef678b9f1a
4
- data.tar.gz: 913cb403236bcde10ba56c482003796a4043ed7c1ff87c6494c488bb76a45739
3
+ metadata.gz: d89b835aabbdb8b3cfc47e4eb34b4da0b9d9e10a6106db1fdb3cfd3baed3ed47
4
+ data.tar.gz: 30d161311d0249732208c36b732e39afc2325d2fbdc05619d3498186790c19dd
5
5
  SHA512:
6
- metadata.gz: 1d22bd8f7f64c5315e1ca851207fc494d0c57ba087213ab1572d69b3b94d1370f71c63f667c5b540ff28547c7edc4fce16b27a98dde6a81b9332d217254c33ce
7
- data.tar.gz: ab78fff0bdbe7124d05c9b433f463e619f488536f58437df79856a27db45d85d1adb4d52615b2008bb870b913bff7e1ace84141cd5575097de7e826338f38e89
6
+ metadata.gz: 6e8530d3c2327ee1b193a2cb80c0bd5264f67f3e0914b08ff62fb374a078579ca3c47f09177602d1cc3603b1598c61bc2a6101e94a718e2d4d1a97e5d6453eee
7
+ data.tar.gz: 0f4d8ced9f652f6bc9394a98e663ebb9cdc7cb606256e798a1d720b3f9c73094c30d34a56e3e852b7e985734f392535bd4291de9a9f38725304f36dc9caff281
@@ -45,9 +45,14 @@ class Vanagon
45
45
  target_list = options[:targets].split(',')
46
46
  end
47
47
 
48
+ only_build = []
49
+ unless options[:only_build].nil? || options[:only_build].empty?
50
+ only_build = options[:only_build].split(',')
51
+ end
52
+
48
53
  platform_list.zip(target_list).each do |pair|
49
54
  platform, target = pair
50
- artifact = Vanagon::Driver.new(platform, project, options.merge({ :target => target }))
55
+ artifact = Vanagon::Driver.new(platform, project, options.merge({ :target => target, :only_build => only_build }))
51
56
  artifact.run
52
57
  end
53
58
  end
@@ -18,11 +18,12 @@ class Vanagon
18
18
 
19
19
  class << self
20
20
  # Attempt to connect to whatever URL is provided and
21
- # return True or False depending on whether or not
21
+ # return true or false depending on whether or not
22
22
  # `git` thinks it's a valid Git repo.
23
23
  #
24
- # @param url
25
- # @param timeout Time (in seconds) to wait before assuming the
24
+ # @param url [#to_s] A URI::HTTPS, URI:HTTP, or String with the the URL of the
25
+ # remote git repository.
26
+ # @param timeout [Number] Time (in seconds) to wait before assuming the
26
27
  # git command has failed. Useful in instances where a URL
27
28
  # prompts for credentials despite not being a git remote
28
29
  # @return [Boolean] whether #url is a valid Git repo or not
@@ -34,30 +35,22 @@ class Vanagon
34
35
  # with: NoMethodError: undefined method `split' for nil:NilClass
35
36
  #
36
37
  # We'll work around that case by calling 'git ls-remote' directly ourselves.
37
- #
38
- # I'm leaving in the broken version here for a time when the ruby-git library
39
- # is fixed.
40
-
41
- #def valid_remote?(url, timeout = 0)
42
- # Timeout.timeout(timeout) do
43
- # !!::Git.ls_remote(url)
44
- # end
45
- #rescue ::Git::GitExecuteError
46
- # false
47
- #rescue Timeout::Error
48
- # false
49
- #end
50
38
 
51
39
  def valid_remote?(url, timeout = 0)
52
- Timeout.timeout(timeout) do
53
- Vanagon::Utilities.local_command("git ls-remote --heads #{url} > /dev/null 2>&1")
54
- return false unless $?.exitstatus.zero?
55
- return true
40
+ # RE-15209. To relieve github rate-limiting, if the URL starts with
41
+ # https://github.com/... just accept it rather than ping github over and over.
42
+ return true if url.to_s.start_with?('https://github.com/')
43
+
44
+ begin
45
+ Timeout.timeout(timeout) do
46
+ Vanagon::Utilities.local_command("git ls-remote --heads #{url} > /dev/null 2>&1")
47
+ $?.exitstatus.zero?
48
+ end
49
+ rescue RuntimeError
50
+ # Either a Timeout::Error or some other execution exception that we'll just call
51
+ # 'invalid'
52
+ false
56
53
  end
57
- rescue Timeout::Error
58
- return false
59
- rescue RuntimeError
60
- return false
61
54
  end
62
55
  end
63
56
 
@@ -37,7 +37,9 @@ class Vanagon
37
37
  )
38
38
  @project.settings[:verbose] = options[:verbose]
39
39
  @project.settings[:skipcheck] = options[:skipcheck] || false
40
- filter_out_components(only_build) if only_build
40
+ if only_build && !only_build.empty?
41
+ filter_out_components(only_build)
42
+ end
41
43
  loginit('vanagon_hosts.log')
42
44
 
43
45
  @remote_workdir = options[:"remote-workdir"]
@@ -125,12 +125,17 @@ describe 'Vanagon::Engine::AlwaysBeScheduling' do
125
125
  allow(File).to receive(:exist?)
126
126
  .with(floaty_config)
127
127
  .and_return(true)
128
+
128
129
  end
129
130
  token_value = 'decade'
130
131
  it %(reads a token from '~/.vmfloaty.yml at the top level') do
131
132
  allow(YAML).to receive(:load_file)
132
133
  .with(floaty_config)
133
134
  .and_return({'token' => token_value})
135
+ allow(ENV).to receive(:[])
136
+ allow(ENV).to receive(:[])
137
+ .with('VMPOOLER_TOKEN')
138
+ .and_return(nil)
134
139
 
135
140
  abs_service = Vanagon::Engine::AlwaysBeScheduling.new(platform, nil)
136
141
  expect(abs_service.token).to eq(token_value)
@@ -142,6 +147,10 @@ describe 'Vanagon::Engine::AlwaysBeScheduling' do
142
147
  .and_return({'services' =>
143
148
  {'MYabs' => {'type'=>'abs', 'token'=>token_value, 'url'=>'foo'}}
144
149
  })
150
+ allow(ENV).to receive(:[])
151
+ allow(ENV).to receive(:[])
152
+ .with('VMPOOLER_TOKEN')
153
+ .and_return(nil)
145
154
 
146
155
  abs_service = Vanagon::Engine::AlwaysBeScheduling.new(platform, nil)
147
156
  expect(abs_service.token).to eq(token_value)
@@ -193,4 +202,4 @@ describe 'Vanagon::Engine::AlwaysBeScheduling' do
193
202
  expect(abs_service.target).to eq(hostname)
194
203
  end
195
204
  end
196
- end
205
+ end
@@ -80,6 +80,7 @@ describe Vanagon::Utilities::ExtraFilesSigner do
80
80
  context 'when success' do
81
81
  context 'when macos' do
82
82
  it 'generates signing commands for each file using --extended-attributes' do
83
+ stub_const('ENV', ENV.to_hash.merge('VANAGON_SSH_KEY' => nil))
83
84
  commands = Vanagon::Utilities::ExtraFilesSigner.commands(project._project, mktemp, source_dir)
84
85
  expected_commands = [
85
86
  %q(/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no test@abc "echo 'codesign /tmp/xyz/a.rb' > /tmp/xyz/sign_extra_file"),
@@ -112,6 +113,7 @@ describe Vanagon::Utilities::ExtraFilesSigner do
112
113
  let(:platform) { Vanagon::Platform::DSL.new('windows-2012r2-x86_64') }
113
114
 
114
115
  it 'generates signing commands for each file' do
116
+ stub_const('ENV', ENV.to_hash.merge('VANAGON_SSH_KEY' => nil))
115
117
  commands = Vanagon::Utilities::ExtraFilesSigner.commands(project._project, mktemp, source_dir)
116
118
  expected_commands = [
117
119
  %q(/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no test@abc "echo 'codesign /tmp/xyz/a.rb' > /tmp/xyz/sign_extra_file"),
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.31.0
4
+ version: 0.32.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-10-05 00:00:00.000000000 Z
11
+ date: 2023-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docopt
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.11.0
33
+ version: 1.13.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.11.0
40
+ version: 1.13.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: fustigit
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -327,42 +327,42 @@ signing_key:
327
327
  specification_version: 3
328
328
  summary: All of your packages will fit into this van with this one simple trick.
329
329
  test_files:
330
- - spec/lib/vanagon/platform_spec.rb
331
- - spec/lib/vanagon/platform/solaris_11_spec.rb
332
- - spec/lib/vanagon/platform/solaris_10_spec.rb
333
- - spec/lib/vanagon/platform/osx_spec.rb
334
- - spec/lib/vanagon/platform/rpm/aix_spec.rb
335
- - spec/lib/vanagon/platform/rpm_spec.rb
336
- - spec/lib/vanagon/platform/windows_spec.rb
337
- - spec/lib/vanagon/platform/dsl_spec.rb
338
- - spec/lib/vanagon/platform/deb_spec.rb
339
- - spec/lib/vanagon/utilities_spec.rb
340
- - spec/lib/vanagon/cli_spec.rb
330
+ - spec/lib/makefile_spec.rb
331
+ - spec/lib/vanagon/project/dsl_spec.rb
332
+ - spec/lib/vanagon/component_spec.rb
333
+ - spec/lib/vanagon/utilities/extra_files_signer_spec.rb
334
+ - spec/lib/vanagon/utilities/shell_utilities_spec.rb
335
+ - spec/lib/vanagon/engine/always_be_scheduling_spec.rb
336
+ - spec/lib/vanagon/engine/hardware_spec.rb
341
337
  - spec/lib/vanagon/engine/docker_spec.rb
338
+ - spec/lib/vanagon/engine/local_spec.rb
342
339
  - spec/lib/vanagon/engine/base_spec.rb
343
340
  - spec/lib/vanagon/engine/ec2_spec.rb
344
- - spec/lib/vanagon/engine/always_be_scheduling_spec.rb
345
341
  - spec/lib/vanagon/engine/pooler_spec.rb
346
- - spec/lib/vanagon/engine/local_spec.rb
347
- - spec/lib/vanagon/engine/hardware_spec.rb
348
- - spec/lib/vanagon/project_spec.rb
349
- - spec/lib/vanagon/component_spec.rb
350
- - spec/lib/vanagon/environment_spec.rb
342
+ - spec/lib/vanagon/common/pathname_spec.rb
343
+ - spec/lib/vanagon/common/user_spec.rb
351
344
  - spec/lib/vanagon/driver_spec.rb
345
+ - spec/lib/vanagon/cli_spec.rb
346
+ - spec/lib/vanagon/project_spec.rb
347
+ - spec/lib/vanagon/utilities_spec.rb
352
348
  - spec/lib/vanagon/extensions/ostruct/json_spec.rb
353
- - spec/lib/vanagon/extensions/set/json_spec.rb
354
349
  - spec/lib/vanagon/extensions/string_spec.rb
355
- - spec/lib/vanagon/common/pathname_spec.rb
356
- - spec/lib/vanagon/common/user_spec.rb
357
- - spec/lib/vanagon/project/dsl_spec.rb
350
+ - spec/lib/vanagon/extensions/set/json_spec.rb
351
+ - spec/lib/vanagon/platform/windows_spec.rb
352
+ - spec/lib/vanagon/platform/solaris_10_spec.rb
353
+ - spec/lib/vanagon/platform/osx_spec.rb
354
+ - spec/lib/vanagon/platform/solaris_11_spec.rb
355
+ - spec/lib/vanagon/platform/rpm/aix_spec.rb
356
+ - spec/lib/vanagon/platform/deb_spec.rb
357
+ - spec/lib/vanagon/platform/dsl_spec.rb
358
+ - spec/lib/vanagon/platform/rpm_spec.rb
359
+ - spec/lib/vanagon/platform_spec.rb
358
360
  - spec/lib/vanagon/component/rules_spec.rb
359
- - spec/lib/vanagon/component/source_spec.rb
361
+ - spec/lib/vanagon/component/dsl_spec.rb
360
362
  - spec/lib/vanagon/component/source/rewrite_spec.rb
361
- - spec/lib/vanagon/component/source/git_spec.rb
362
363
  - spec/lib/vanagon/component/source/http_spec.rb
363
364
  - spec/lib/vanagon/component/source/local_spec.rb
364
- - spec/lib/vanagon/component/dsl_spec.rb
365
- - spec/lib/vanagon/utilities/extra_files_signer_spec.rb
366
- - spec/lib/vanagon/utilities/shell_utilities_spec.rb
367
- - spec/lib/makefile_spec.rb
365
+ - spec/lib/vanagon/component/source/git_spec.rb
366
+ - spec/lib/vanagon/component/source_spec.rb
367
+ - spec/lib/vanagon/environment_spec.rb
368
368
  - spec/lib/git/rev_list_spec.rb