vanagon 0.31.0 → 0.33.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: 718f4dcae29abb28a3e5d5f2b9fcbff10b72b4dd67e429081de972c3b1c83187
4
+ data.tar.gz: 60554657592055e15a3ca89fc2970f3feb6d93ccef04923d85bee3eda3216c2a
5
5
  SHA512:
6
- metadata.gz: 1d22bd8f7f64c5315e1ca851207fc494d0c57ba087213ab1572d69b3b94d1370f71c63f667c5b540ff28547c7edc4fce16b27a98dde6a81b9332d217254c33ce
7
- data.tar.gz: ab78fff0bdbe7124d05c9b433f463e619f488536f58437df79856a27db45d85d1adb4d52615b2008bb870b913bff7e1ace84141cd5575097de7e826338f38e89
6
+ metadata.gz: ea7d6c24ef3ca5e8776d8c1e9340e8893e17f578ff78d6fa190988b550849199187b4d16a3357a65b636567a1f5648493fa65b88af08e23d73e605c7ac70bcf6
7
+ data.tar.gz: 44f3be6655ef5d0caf974eddcc2178c5a9723ca3c58e68790adcd3067e7276b26d2767f025634b2cc3f1bf59daca33c48ced3fcc7035bae298ed4fd6f6c53af3
@@ -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"]
@@ -0,0 +1,29 @@
1
+ platform 'el-8-ppc64le' do |plat|
2
+ plat.servicedir '/usr/lib/systemd/system'
3
+ plat.defaultdir '/etc/sysconfig'
4
+ plat.servicetype 'systemd'
5
+
6
+ # Workaround for an issue with RedHat subscription metadata, see ITSYS-2543
7
+ plat.provision_with('subscription-manager repos --disable rhel-8-for-ppc64le-baseos-rpms && subscription-manager repos --enable rhel-8-for-ppc64le-baseos-rpms')
8
+
9
+ packages = %w(
10
+ autoconf
11
+ automake
12
+ cmake
13
+ gcc-c++
14
+ java-1.8.0-openjdk-devel
15
+ libarchive
16
+ libselinux-devel
17
+ make
18
+ patch
19
+ perl-Getopt-Long
20
+ readline-devel
21
+ swig
22
+ systemtap-sdt-devel
23
+ zlib-devel
24
+ )
25
+
26
+ plat.provision_with("dnf install -y --allowerasing #{packages.join(' ')}")
27
+ plat.install_build_dependencies_with 'dnf install -y --allowerasing'
28
+ plat.vmpooler_template 'redhat-8-power8'
29
+ end
@@ -4,7 +4,28 @@ platform "redhatfips-7-x86_64" do |plat|
4
4
  plat.servicetype "systemd"
5
5
 
6
6
  plat.add_build_repository "http://pl-build-tools.delivery.puppetlabs.net/yum/pl-build-tools-release-el-7.noarch.rpm"
7
- packages = %w(autoconf automake createrepo rsync gcc make rpmdevtools rpm-libs yum-utils rpm-sign)
7
+ packages = %w(
8
+ autoconf
9
+ automake
10
+ createrepo
11
+ gcc
12
+ java-1.8.0-openjdk-devel
13
+ libsepol
14
+ libsepol-devel
15
+ libselinux-devel
16
+ make
17
+ openssl-devel
18
+ pkgconfig
19
+ readline-devel
20
+ rpmdevtools
21
+ rpm-build
22
+ rpm-libs
23
+ rpm-sign
24
+ rsync
25
+ swig
26
+ yum-utils
27
+ zlib-devel
28
+ )
8
29
  plat.provision_with "yum install --assumeyes #{packages.join(' ')}"
9
30
  plat.install_build_dependencies_with "yum install --assumeyes"
10
31
  plat.vmpooler_template "redhat-fips-7-x86_64"
@@ -4,6 +4,8 @@ platform "redhatfips-8-x86_64" do |plat|
4
4
  plat.servicetype "systemd"
5
5
 
6
6
  packages = %w(
7
+ autoconf
8
+ automake
7
9
  cmake
8
10
  gcc-c++
9
11
  java-1.8.0-openjdk-devel
@@ -13,8 +15,8 @@ platform "redhatfips-8-x86_64" do |plat|
13
15
  openssl-devel
14
16
  pkgconfig
15
17
  readline-devel
16
- rpm-build
17
18
  rpmdevtools
19
+ rpm-build
18
20
  rsync
19
21
  swig
20
22
  systemtap-sdt-devel
@@ -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.33.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-13 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
@@ -162,6 +162,7 @@ files:
162
162
  - lib/vanagon/platform/defaults/el-7-aarch64.rb
163
163
  - lib/vanagon/platform/defaults/el-7-x86_64.rb
164
164
  - lib/vanagon/platform/defaults/el-8-aarch64.rb
165
+ - lib/vanagon/platform/defaults/el-8-ppc64le.rb
165
166
  - lib/vanagon/platform/defaults/el-8-x86_64.rb
166
167
  - lib/vanagon/platform/defaults/el-9-aarch64.rb
167
168
  - lib/vanagon/platform/defaults/el-9-x86_64.rb
@@ -327,42 +328,42 @@ signing_key:
327
328
  specification_version: 3
328
329
  summary: All of your packages will fit into this van with this one simple trick.
329
330
  test_files:
331
+ - spec/lib/vanagon/common/pathname_spec.rb
332
+ - spec/lib/vanagon/common/user_spec.rb
333
+ - spec/lib/vanagon/project_spec.rb
330
334
  - 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
335
+ - spec/lib/vanagon/component_spec.rb
339
336
  - spec/lib/vanagon/utilities_spec.rb
340
337
  - spec/lib/vanagon/cli_spec.rb
338
+ - spec/lib/vanagon/driver_spec.rb
339
+ - spec/lib/vanagon/environment_spec.rb
340
+ - spec/lib/vanagon/project/dsl_spec.rb
341
+ - spec/lib/vanagon/engine/hardware_spec.rb
342
+ - spec/lib/vanagon/engine/always_be_scheduling_spec.rb
343
+ - spec/lib/vanagon/engine/ec2_spec.rb
341
344
  - spec/lib/vanagon/engine/docker_spec.rb
342
345
  - spec/lib/vanagon/engine/base_spec.rb
343
- - spec/lib/vanagon/engine/ec2_spec.rb
344
- - spec/lib/vanagon/engine/always_be_scheduling_spec.rb
345
346
  - spec/lib/vanagon/engine/pooler_spec.rb
346
347
  - 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
351
- - spec/lib/vanagon/driver_spec.rb
352
348
  - spec/lib/vanagon/extensions/ostruct/json_spec.rb
353
349
  - spec/lib/vanagon/extensions/set/json_spec.rb
354
350
  - 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
358
351
  - spec/lib/vanagon/component/rules_spec.rb
359
352
  - spec/lib/vanagon/component/source_spec.rb
353
+ - spec/lib/vanagon/component/dsl_spec.rb
360
354
  - spec/lib/vanagon/component/source/rewrite_spec.rb
361
355
  - spec/lib/vanagon/component/source/git_spec.rb
362
- - spec/lib/vanagon/component/source/http_spec.rb
363
356
  - 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
357
+ - spec/lib/vanagon/component/source/http_spec.rb
358
+ - spec/lib/vanagon/platform/solaris_11_spec.rb
359
+ - spec/lib/vanagon/platform/windows_spec.rb
360
+ - spec/lib/vanagon/platform/rpm_spec.rb
361
+ - spec/lib/vanagon/platform/osx_spec.rb
362
+ - spec/lib/vanagon/platform/deb_spec.rb
363
+ - spec/lib/vanagon/platform/rpm/aix_spec.rb
364
+ - spec/lib/vanagon/platform/solaris_10_spec.rb
365
+ - spec/lib/vanagon/platform/dsl_spec.rb
366
366
  - spec/lib/vanagon/utilities/shell_utilities_spec.rb
367
- - spec/lib/makefile_spec.rb
367
+ - spec/lib/vanagon/utilities/extra_files_signer_spec.rb
368
368
  - spec/lib/git/rev_list_spec.rb
369
+ - spec/lib/makefile_spec.rb