vanagon 0.45.0 → 0.47.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: 1c546f8edcbbaea0e769f628853a335eb9bb803dd15878d32ea1c53c0f12332d
4
- data.tar.gz: fcef0a81a70177ec1e9b0050ca2a200f2f7c7d17e79dfc1b767c603131984b6d
3
+ metadata.gz: 4a166d92c2d23c1fce61aa5ba9a05b9c41571738b8571fd01c2a97d15cc44fb7
4
+ data.tar.gz: '00979e76b8f21b4992c47d5bf6aa4be3290d2e5914062952bc7e05ddbf7f0eb8'
5
5
  SHA512:
6
- metadata.gz: 33aba6ddd2ea2b085576b9fd874be05ea88f85c53a3dba409863e788b0693592f842aca61181b935d32f97ec29ebda558b3c01ac753bef607a9a8a657d842686
7
- data.tar.gz: 5c3e43f7185de14b638f50f5abeda4fffaaf3b626ebd40e6c767f3d0fa80a9fb33f6d74bf0b45644c89a072c60d81a56f75d5e0a32fe5249d8ac9c93c6f810bf
6
+ metadata.gz: a2203572e393abc4b6a653353ce359231bad6837904ba63d8138d6c1fac73c521a16360e177d2d52cde66c6db452ea3f477a5b9b8abd56c88d2763d092d9ce41
7
+ data.tar.gz: 45a19856e054337092ba6802aee517384bd8280d9d15492b7abac9c8014456b7f89c2e74179ea03f5235c4a349fe4f35f28a435f32f5ad8940cfde58437a6acf
@@ -4,7 +4,7 @@ require 'vanagon/logger'
4
4
  # This stupid library requires a capital 'E' in its name
5
5
  # but it provides a wealth of useful constants
6
6
  require 'English'
7
- require 'fustigit'
7
+ require 'build/uri'
8
8
  require 'git/basic_submodules'
9
9
  require 'logger'
10
10
  require 'timeout'
@@ -98,7 +98,7 @@ class Vanagon
98
98
  opts = default_options.merge(options.reject { |k, v| v.nil? })
99
99
 
100
100
  # Ensure that #url returns a URI object
101
- @url = URI.parse(url.to_s)
101
+ @url = Build::URI.parse(url.to_s)
102
102
  @log_url = @url.host + @url.path unless @url.host.nil? || @url.path.nil?
103
103
  @ref = opts[:ref]
104
104
  @dirname = opts[:dirname]
@@ -78,11 +78,12 @@ class Vanagon
78
78
  return uri if rewrite_rules.empty?
79
79
  if !!uri.match(/^git:http/)
80
80
  VanagonLogger.info <<-HERE.undent
81
- `fustigit` parsing doesn't get along with how we specify the source
81
+ `build-uri` parsing doesn't get along with how we specify the source
82
82
  type by prefixing `git`. As `rewrite_rules` are deprecated, we'll
83
83
  replace `git:http` with `http` in your uri. At some point this will
84
84
  break.
85
85
  HERE
86
+ # build-uri does not support git:http://host/path
86
87
  uri.sub!(/^git:http/, 'http')
87
88
  end
88
89
  url = URI.parse(uri)
@@ -1,4 +1,3 @@
1
- require 'fustigit'
2
1
  require 'vanagon/logger'
3
2
  require 'vanagon/component/source/http'
4
3
  require 'vanagon/component/source/git'
@@ -0,0 +1,29 @@
1
+ platform 'el-9-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-9-for-ppc64le-baseos-rpms && subscription-manager repos --enable rhel-9-for-ppc64le-baseos-rpms --enable codeready-builder-for-rhel-9-ppc64le-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-9-power9'
29
+ end
@@ -13,55 +13,57 @@ describe 'Vanagon::Project' do
13
13
  OpenStruct.new(:settings => {})
14
14
  end
15
15
 
16
- let(:project_block) {
16
+ let(:project_block) do
17
17
  "project 'test-fixture' do |proj|
18
18
  proj.component 'some-component'
19
19
  end"
20
- }
20
+ end
21
21
 
22
- let(:upstream_project_block) {
22
+ let(:upstream_project_block) do
23
23
  "project 'upstream-test' do |proj|
24
24
  proj.setting(:test, 'upstream-test')
25
25
  end"
26
- }
26
+ end
27
27
 
28
- let(:inheriting_project_block) {
28
+ let(:inheriting_project_block) do
29
29
  "project 'inheritance-test' do |proj|
30
30
  proj.inherit_settings 'upstream-test', 'git://some.url', 'master'
31
31
  end"
32
- }
32
+ end
33
33
 
34
- let(:inheriting_project_block_with_settings) {
34
+ let(:inheriting_project_block_with_settings) do
35
35
  "project 'inheritance-test' do |proj|
36
36
  proj.setting(:merged, 'yup')
37
37
  proj.inherit_settings 'upstream-test', 'git://some.url', 'master'
38
38
  end"
39
- }
39
+ end
40
40
 
41
- let(:preset_inheriting_project_block) {
41
+ let(:preset_inheriting_project_block) do
42
42
  "project 'inheritance-test' do |proj|
43
43
  proj.setting(:test, 'inheritance-test')
44
44
  proj.inherit_settings 'upstream-test', 'git://some.url', 'master'
45
45
  end"
46
- }
46
+ end
47
47
 
48
- let(:postset_inheriting_project_block) {
48
+ let(:postset_inheriting_project_block) do
49
49
  "project 'inheritance-test' do |proj|
50
50
  proj.inherit_settings 'upstream-test', 'git://some.url', 'master'
51
51
  proj.setting(:test, 'inheritance-test')
52
52
  end"
53
- }
53
+ end
54
54
 
55
- let (:dummy_platform_settings) {
55
+ let (:dummy_platform_settings) do
56
56
  plat = Vanagon::Platform::DSL.new('debian-6-i386')
57
- plat.instance_eval("platform 'debian-6-i386' do |plat|
58
- plat.servicetype 'sysv'
59
- plat.servicedir '/etc/init.d'
60
- plat.defaultdir '/etc/default'
61
- settings[:platform_test] = 'debian'
62
- end")
57
+ plat.instance_eval <<-END_EVAL, __FILE__, __LINE__ + 1
58
+ platform 'debian-6-i386' do |plat|
59
+ plat.servicetype 'sysv'
60
+ plat.servicedir '/etc/init.d'
61
+ plat.defaultdir '/etc/default'
62
+ settings[:platform_test] = 'debian'
63
+ end
64
+ END_EVAL
63
65
  plat._platform
64
- }
66
+ end
65
67
 
66
68
 
67
69
  describe '#vendor=' do
@@ -71,7 +73,8 @@ describe 'Vanagon::Project' do
71
73
 
72
74
  it 'fails if vendor field does not include email address' do
73
75
  project = Vanagon::Project.new('vendor-test', dummy_platform)
74
- expect { project.vendor = bad_vendor }.to raise_error(Vanagon::Error, /Project vendor field must include email address/)
76
+ expect { project.vendor = bad_vendor }
77
+ .to raise_error(Vanagon::Error, /Project vendor field must include email address/)
75
78
  end
76
79
 
77
80
  it 'sets project vendor to the supplied value' do
@@ -98,7 +101,6 @@ describe 'Vanagon::Project' do
98
101
  end
99
102
 
100
103
  describe '#get_root_directories' do
101
-
102
104
  before do
103
105
  allow_any_instance_of(Vanagon::Project::DSL).to receive(:puts)
104
106
  allow(Vanagon::Driver).to receive(:configdir).and_return(configdir)
@@ -108,22 +110,25 @@ describe 'Vanagon::Project' do
108
110
  let(:test_sets) do
109
111
  [
110
112
  {
111
- :directories => ["/opt/puppetlabs/bin", "/etc/puppetlabs", "/var/log/puppetlabs", "/etc/puppetlabs/puppet", "/opt/puppetlabs"],
113
+ :directories => ["/opt/puppetlabs/bin", "/etc/puppetlabs", "/var/log/puppetlabs",
114
+ "/etc/puppetlabs/puppet", "/opt/puppetlabs"],
112
115
  :results => ["/opt/puppetlabs", "/etc/puppetlabs", "/var/log/puppetlabs"],
113
116
  },
114
117
  {
115
- :directories => ["/opt/puppetlabs/bin", "/etc/puppetlabs", "/var/log/puppetlabs", "/etc/puppetlabs/puppet", "/opt/puppetlabs/lib"],
116
- :results => ["/opt/puppetlabs/bin", "/etc/puppetlabs", "/var/log/puppetlabs", "/opt/puppetlabs/lib"],
118
+ :directories => ["/opt/puppetlabs/bin", "/etc/puppetlabs", "/var/log/puppetlabs",
119
+ "/etc/puppetlabs/puppet", "/opt/puppetlabs/lib"],
120
+ :results => ["/opt/puppetlabs/bin", "/etc/puppetlabs", "/var/log/puppetlabs",
121
+ "/opt/puppetlabs/lib"],
117
122
  },
118
123
  ]
119
124
  end
120
125
 
121
126
  it 'returns only the highest level directories' do
122
127
  test_sets.each do |set|
123
- expect(component).to receive(:directories).and_return([])
128
+ allow(component).to receive(:directories).and_return([])
124
129
  proj = Vanagon::Project::DSL.new('test-fixture', configdir, platform, [])
125
130
  proj.instance_eval(project_block)
126
- set[:directories].each {|dir| proj.directory dir }
131
+ set[:directories].each { |dir| proj.directory dir }
127
132
  expect(proj._project.get_root_directories.sort).to eq(set[:results].sort)
128
133
  end
129
134
  end
@@ -132,16 +137,19 @@ describe 'Vanagon::Project' do
132
137
  describe "#load_upstream_settings" do
133
138
  before(:each) do
134
139
  # stub out all of the git methods so we don't actually clone
135
- allow(Vanagon::Component::Source::Git).to receive(:valid_remote?).with(URI.parse('git://some.url')).and_return(true)
140
+ allow(Vanagon::Component::Source::Git)
141
+ .to receive(:valid_remote?)
142
+ .with(Build::URI.parse('git://some.url'))
143
+ .and_return(true)
136
144
  git_source = Vanagon::Component::Source::Git.new('git://some.url', workdir: Dir.getwd)
137
145
  allow(Vanagon::Component::Source::Git).to receive(:new).and_return(git_source)
138
- expect(git_source).to receive(:fetch).and_return(true)
146
+ allow(git_source).to receive(:fetch).and_return(true)
139
147
 
140
148
  # stubs for the upstream project
141
149
  upstream_proj = Vanagon::Project::DSL.new('upstream-test', configdir, upstream_platform, [])
142
150
  upstream_proj.instance_eval(upstream_project_block)
143
- expect(Vanagon::Project).to receive(:load_project).and_return(upstream_proj._project)
144
- expect(Vanagon::Platform).to receive(:load_platform).and_return(upstream_platform)
151
+ allow(Vanagon::Project).to receive(:load_project).and_return(upstream_proj._project)
152
+ allow(Vanagon::Platform).to receive(:load_platform).and_return(upstream_platform)
145
153
 
146
154
  class Vanagon
147
155
  class Project
@@ -182,8 +190,8 @@ describe 'Vanagon::Project' do
182
190
  before do
183
191
  allow(Vanagon::Component)
184
192
  .to receive(:load_component)
185
- .with('some-component', any_args)
186
- .and_return(component)
193
+ .with('some-component', any_args)
194
+ .and_return(component)
187
195
  end
188
196
 
189
197
  it 'loads settings set in platforms' do
@@ -232,8 +240,8 @@ describe 'Vanagon::Project' do
232
240
  it "fails if downloading over HTTP without a valid sha1sum URI" do
233
241
  allow(Vanagon::Component::Source::Http)
234
242
  .to receive(:valid_url?)
235
- .with(http_yaml_uri)
236
- .and_return(true)
243
+ .with(http_yaml_uri)
244
+ .and_return(true)
237
245
  http_source = instance_double(Vanagon::Component::Source::Http)
238
246
  allow(Vanagon::Component::Source).to receive(:source).and_return(http_source)
239
247
  allow(http_source).to receive(:verify).and_return(true)
@@ -241,7 +249,7 @@ describe 'Vanagon::Project' do
241
249
  expect { project.load_yaml_settings(http_yaml_uri) }.to raise_error(Vanagon::Error)
242
250
  end
243
251
 
244
- context "given a valid source" do
252
+ context "with a valid source" do
245
253
  before(:each) do
246
254
  local_source = instance_double(Vanagon::Component::Source::Local)
247
255
  allow(local_source).to receive(:fetch)
@@ -425,7 +433,7 @@ describe 'Vanagon::Project' do
425
433
  @proj = Vanagon::Project.new('test-project', platform)
426
434
  end
427
435
 
428
- it 'should generate a hash with the expected build metadata' do
436
+ it 'generates a hash with the expected build metadata' do
429
437
  comp1 = Vanagon::Component.new('test-component1', {}, {})
430
438
  comp1.version = '1.0.0'
431
439
  @proj.components << comp1
@@ -439,7 +447,7 @@ describe 'Vanagon::Project' do
439
447
  })
440
448
  end
441
449
 
442
- it 'should call pretty-print when we want pretty json' do
450
+ it 'calls pretty-print when we want pretty json' do
443
451
  comp1 = Vanagon::Component.new('test-component1', {}, {})
444
452
  comp1.version = '1.0.0'
445
453
  @proj.components << comp1
@@ -454,6 +462,7 @@ describe 'Vanagon::Project' do
454
462
  include FakeFS::SpecHelpers
455
463
  let(:platform_name) { 'el-7-x86_64' }
456
464
  let(:platform) { Vanagon::Platform.new(platform_name) }
465
+
457
466
  before(:each) do
458
467
  class Vanagon
459
468
  class Project
@@ -465,7 +474,7 @@ describe 'Vanagon::Project' do
465
474
  @proj = Vanagon::Project.new('test-project', platform)
466
475
  end
467
476
 
468
- it 'should generate a file with the expected build metadata' do
477
+ it 'generates a file with the expected build metadata' do
469
478
  correct_sample_metadata = {
470
479
  'packaging_type' => { 'vanagon' => '0.0.0-rspec' },
471
480
  'version' => '123abcde',
@@ -495,9 +504,6 @@ describe 'Vanagon::Project' do
495
504
 
496
505
 
497
506
  describe '#publish_yaml_settings' do
498
- let(:platform_name) { 'aix-7.2-ppc' }
499
- let(:platform) { Vanagon::Platform.new(platform_name) }
500
-
501
507
  subject(:project) do
502
508
  project = Vanagon::Project.new('test-project', platform)
503
509
  project.settings = { key: 'value' }
@@ -506,8 +512,16 @@ describe 'Vanagon::Project' do
506
512
  project
507
513
  end
508
514
 
509
- let(:yaml_output_path) { File.expand_path("test-project-version.#{platform_name}.settings.yaml", "output") }
510
- let(:sha1_output_path) { File.expand_path("test-project-version.#{platform_name}.settings.yaml.sha1", "output") }
515
+ let(:platform_name) { 'aix-7.2-ppc' }
516
+ let(:platform) { Vanagon::Platform.new(platform_name) }
517
+
518
+
519
+ let(:yaml_output_path) do
520
+ File.expand_path("test-project-version.#{platform_name}.settings.yaml", "output")
521
+ end
522
+ let(:sha1_output_path) do
523
+ File.expand_path("test-project-version.#{platform_name}.settings.yaml.sha1", "output")
524
+ end
511
525
 
512
526
  let(:yaml_file) { double('yaml_file') }
513
527
  let(:sha1_file) { double('sha1_file') }
@@ -516,10 +530,10 @@ describe 'Vanagon::Project' do
516
530
  let(:sha1_object) { instance_double(Digest::SHA1, hexdigest: sha1_content) }
517
531
 
518
532
  it 'writes project settings as yaml and a sha1sum for the settings to the output directory' do
519
- expect(File).to receive(:open).with(yaml_output_path, "w").and_yield(yaml_file)
520
- expect(Digest::SHA1).to receive(:file).with(yaml_output_path).and_return(sha1_object)
521
- expect(File).to receive(:open).with(sha1_output_path, "w").and_yield(sha1_file)
522
- expect(yaml_file).to receive(:write).with({key: 'value'}.to_yaml)
533
+ allow(File).to receive(:open).with(yaml_output_path, "w").and_yield(yaml_file)
534
+ allow(Digest::SHA1).to receive(:file).with(yaml_output_path).and_return(sha1_object)
535
+ allow(File).to receive(:open).with(sha1_output_path, "w").and_yield(sha1_file)
536
+ expect(yaml_file).to receive(:write).with({ key: 'value' }.to_yaml)
523
537
  expect(sha1_file).to receive(:puts).with(sha1_content)
524
538
  expect { project.publish_yaml_settings(platform) }.not_to raise_error
525
539
  end
@@ -545,35 +559,39 @@ describe 'Vanagon::Project' do
545
559
  describe '#generate_package' do
546
560
  it "builds packages by default" do
547
561
  platform = Vanagon::Platform::DSL.new('el-7-x86_64')
548
- platform.instance_eval("platform 'el-7-x86_6' do |plat| end")
562
+ platform.instance_eval("platform 'el-7-x86_6' do |plat| end", __FILE__, __LINE__)
549
563
  proj = Vanagon::Project::DSL.new('test-fixture', configdir, platform._platform, [])
550
- expect(platform._platform).to receive(:generate_package) { ["# making a package"] }
564
+ allow(platform._platform).to receive(:generate_package).and_return(["# making a package"])
551
565
  expect(proj._project.generate_package).to eq(["# making a package"])
552
566
  end
553
567
 
554
568
  it "builds packages and archives if configured for both" do
555
569
  platform = Vanagon::Platform::DSL.new('el-7-x86_64')
556
- platform.instance_eval("platform 'el-7-x86_6' do |plat| end")
570
+ platform.instance_eval("platform 'el-7-x86_6' do |plat| end", __FILE__, __LINE__)
557
571
  proj = Vanagon::Project::DSL.new('test-fixture', configdir, platform._platform, [])
558
572
  proj.generate_archives(true)
559
- expect(platform._platform).to receive(:generate_package) { ["# making a package"] }
560
- expect(platform._platform).to receive(:generate_compiled_archive) { ["# making an archive"] }
573
+ allow(platform._platform).to receive(:generate_package).and_return(["# making a package"])
574
+ allow(platform._platform)
575
+ .to receive(:generate_compiled_archive)
576
+ .and_return(["# making an archive"])
561
577
  expect(proj._project.generate_package).to eq(["# making a package", "# making an archive"])
562
578
  end
563
579
 
564
580
  it "can build only archives" do
565
581
  platform = Vanagon::Platform::DSL.new('el-7-x86_64')
566
- platform.instance_eval("platform 'el-7-x86_6' do |plat| end")
582
+ platform.instance_eval("platform 'el-7-x86_6' do |plat| end", __FILE__, __LINE__)
567
583
  proj = Vanagon::Project::DSL.new('test-fixture', configdir, platform._platform, [])
568
584
  proj.generate_archives(true)
569
585
  proj.generate_packages(false)
570
- expect(platform._platform).to receive(:generate_compiled_archive) { ["# making an archive"] }
586
+ allow(platform._platform)
587
+ .to receive(:generate_compiled_archive)
588
+ .and_return(["# making an archive"])
571
589
  expect(proj._project.generate_package).to eq(["# making an archive"])
572
590
  end
573
591
 
574
592
  it "builds nothing if that's what you really want" do
575
593
  platform = Vanagon::Platform::DSL.new('el-7-x86_64')
576
- platform.instance_eval("platform 'el-7-x86_6' do |plat| end")
594
+ platform.instance_eval("platform 'el-7-x86_6' do |plat| end", __FILE__, __LINE__)
577
595
  proj = Vanagon::Project::DSL.new('test-fixture', configdir, platform._platform, [])
578
596
  proj.generate_packages(false)
579
597
  expect(proj._project.generate_package).to eq([])
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.45.0
4
+ version: 0.47.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet By Perforce
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-19 00:00:00.000000000 Z
11
+ date: 2024-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docopt
@@ -39,19 +39,19 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.13.0
41
41
  - !ruby/object:Gem::Dependency
42
- name: fustigit
42
+ name: build-uri
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.3.0
47
+ version: '1.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.3.0
54
+ version: '1.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: lock_manager
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -186,6 +186,7 @@ files:
186
186
  - lib/vanagon/platform/defaults/el-8-ppc64le.rb
187
187
  - lib/vanagon/platform/defaults/el-8-x86_64.rb
188
188
  - lib/vanagon/platform/defaults/el-9-aarch64.rb
189
+ - lib/vanagon/platform/defaults/el-9-ppc64le.rb
189
190
  - lib/vanagon/platform/defaults/el-9-x86_64.rb
190
191
  - lib/vanagon/platform/defaults/fedora-36-x86_64.rb
191
192
  - lib/vanagon/platform/defaults/fedora-38-x86_64.rb