packaging 0.99.1 → 0.99.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0ae6398f2a9568e9a9d75426480aa85940ac5df1
4
- data.tar.gz: d1e290e42fb8c1604ad1b18d938bb7b7567cd11a
3
+ metadata.gz: b096423bbbe6f7b90a9ad4eae12da125c056733c
4
+ data.tar.gz: 370b0e6f7c4869871a187ef12396a1728f3ba193
5
5
  SHA512:
6
- metadata.gz: 32df3b1cc9f5f1ec0bc2a41438aa27f2f49bd67d200790d42df368251138eaa90b4d0de76d508e72eb3041beff8dc8aeb5d2e2c4a6f0af157335ac0484a2ccea
7
- data.tar.gz: bea38c34983114bd4b445390233da4b0677fb8404e7dd819fec1ba766cb5eeae4bd4e18af68eee0d436671c45953e63db0058e288e84027b335892b009aa2f17
6
+ metadata.gz: d634374753ae4ad76adecc223002f66b2796f6b265aae22145a570f52f90c9f0179d647beac93dca131e0c300c99a52aea59ad10ff632fd5db92aef3bc1838e7
7
+ data.tar.gz: a095f56daa4e019ef33fbc71505d31e7bb83f066a116e87eca86eb111474b21e2ba3f21b54582db6449327ed223493421a0560435aad4f3df87ae038ce8ab381
@@ -135,6 +135,14 @@ module Pkg::Platforms # rubocop:disable Metrics/ModuleLength
135
135
  signature_format: 'v4',
136
136
  repo: true,
137
137
  },
138
+ 'f27' => {
139
+ architectures: ['x86_64'],
140
+ source_architecture: 'SRPMS',
141
+ package_format: 'rpm',
142
+ source_package_formats: ['src.rpm'],
143
+ signature_format: 'v4',
144
+ repo: true,
145
+ },
138
146
  '25' => {
139
147
  architectures: ['i386', 'x86_64'],
140
148
  source_architecture: 'SRPMS',
@@ -151,6 +159,14 @@ module Pkg::Platforms # rubocop:disable Metrics/ModuleLength
151
159
  signature_format: 'v4',
152
160
  repo: true,
153
161
  },
162
+ '27' => {
163
+ architectures: ['x86_64'],
164
+ source_architecture: 'SRPMS',
165
+ package_format: 'rpm',
166
+ source_package_formats: ['src.rpm'],
167
+ signature_format: 'v4',
168
+ repo: true,
169
+ },
154
170
  },
155
171
 
156
172
  'osx' => {
@@ -8,9 +8,37 @@ module Pkg::Retrieve
8
8
  # --directory-prefix = where to save to disk (defaults to ./)
9
9
  # --reject = Reject all hits that match the supplied regex
10
10
 
11
- def default_wget(local_target, url)
11
+ def default_wget_command(local_target, url, additional_options = {})
12
+ default_options = {
13
+ 'quiet' => true,
14
+ 'recursive' => true,
15
+ 'no-parent' => true,
16
+ 'no-host-directories' => true,
17
+ 'level' => 0,
18
+ 'cut-dirs' => 3,
19
+ 'directory-prefix' => local_target,
20
+ 'reject' => "'index*'",
21
+ }
22
+ options = default_options.merge(additional_options)
12
23
  wget = Pkg::Util::Tool.check_tool('wget')
13
- wget_command = "#{wget} --quiet --recursive --no-parent --no-host-directories --level=0 --cut-dirs 3 --directory-prefix=#{local_target} --reject 'index*' #{url}"
24
+ wget_command = wget
25
+ options.each do |option, value|
26
+ next unless value
27
+ if value.is_a?(TrueClass)
28
+ wget_command << " --#{option}"
29
+ else
30
+ wget_command << " --#{option}=#{value}"
31
+ end
32
+ end
33
+ wget_command << " #{url}"
34
+ return wget_command
35
+ end
36
+
37
+ # NOTE: When supplying additional options, if you want your value to be
38
+ # quoted (e.g. --reject='index*'), you must include the quotes as part of
39
+ # your string (e.g. {'reject' => "'index*'"}).
40
+ def default_wget(local_target, url, additional_options = {})
41
+ wget_command = default_wget_command(local_target, url, additional_options)
14
42
  puts "Executing #{wget_command} . . ."
15
43
  %x(#{wget_command})
16
44
  end
@@ -20,7 +48,7 @@ module Pkg::Retrieve
20
48
  unless Pkg::Config.foss_platforms
21
49
  fail "FOSS_ONLY specified, but I don't know anything about FOSS_PLATFORMS. Retrieve cancelled."
22
50
  end
23
- default_wget(local_target, "#{build_url}/artifacts/#{Pkg::Config.ref}.yaml")
51
+ default_wget(local_target, "#{build_url}/artifacts/", { 'level' => 1 })
24
52
  yaml_path = File.join(local_target, "#{Pkg::Config.ref}.yaml")
25
53
  unless File.readable?(yaml_path)
26
54
  fail "Couldn't read #{Pkg::Config.ref}.yaml, which is necessary for FOSS_ONLY. Retrieve cancelled."
@@ -351,7 +351,18 @@ module Pkg::Util::Net
351
351
  tarball_name = File.basename(tarball).gsub('.tar.gz', '')
352
352
  Pkg::Util::Net.rsync_to(tarball, host, '/tmp')
353
353
  appendix = Pkg::Util.rand_string
354
- Pkg::Util::Net.remote_ssh_cmd(host, "#{tar} -zxvf /tmp/#{tarball_name}.tar.gz -C /tmp/ ; git clone --recursive /tmp/#{tarball_name} /tmp/#{Pkg::Config.project}-#{appendix} ; cd /tmp/#{Pkg::Config.project}-#{appendix} ; source /usr/local/rvm/scripts/rvm; rvm use ruby-2.3.1; bundle install; bundle exec rake package:bootstrap")
354
+ command = <<-DOC
355
+ #{tar} -zxvf /tmp/#{tarball_name}.tar.gz -C /tmp/ ;
356
+ git clone --recursive /tmp/#{tarball_name} /tmp/#{Pkg::Config.project}-#{appendix} ;
357
+ cd /tmp/#{Pkg::Config.project}-#{appendix} ;
358
+ bundle_prefix= ;
359
+ if [[ -r Gemfile ]]; then
360
+ source /usr/local/rvm/scripts/rvm; rvm use ruby-2.3.1; bundle install --path .bundle/gems ;
361
+ bundle_prefix='bundle exec' ;
362
+ fi ;
363
+ $bundle_prefix rake package:bootstrap
364
+ DOC
365
+ Pkg::Util::Net.remote_ssh_cmd(host, command)
355
366
  "/tmp/#{Pkg::Config.project}-#{appendix}"
356
367
  end
357
368
 
@@ -28,6 +28,44 @@ describe 'Pkg::Retrieve' do
28
28
  allow(Pkg::Util::Serialization).to receive(:load_yaml).and_return(platform_data)
29
29
  end
30
30
 
31
+ describe '#default_wget_command' do
32
+ let(:options) { [
33
+ "--quiet",
34
+ "--recursive",
35
+ "--no-parent",
36
+ "--no-host-directories",
37
+ "--level=0",
38
+ "--cut-dirs=3",
39
+ "--directory-prefix=#{local_target}",
40
+ "--reject='index*",
41
+ ] }
42
+ before :each do
43
+ allow(Pkg::Util::Tool).to receive(:check_tool).with('wget').and_return('wget')
44
+ end
45
+ context 'when no options passed' do
46
+ it 'should include default options' do
47
+ options.each do |option|
48
+ expect(Pkg::Retrieve.default_wget_command(local_target, build_url)).to include(option)
49
+ end
50
+ end
51
+ end
52
+ context 'when options are passed' do
53
+ it 'should add to existing options' do
54
+ options.push('--convert-links')
55
+ options.each do |option|
56
+ expect(Pkg::Retrieve.default_wget_command(local_target, build_url, {'convert-links' => true})).to include(option)
57
+ end
58
+ end
59
+ it 'should replace default values' do
60
+ options.push('--level=1').delete('--level=0')
61
+ expect(Pkg::Retrieve.default_wget_command(local_target, build_url, {'level' => 1})).to_not include('--level=0')
62
+ options.each do |option|
63
+ expect(Pkg::Retrieve.default_wget_command(local_target, build_url, {'level' => 1})).to include(option)
64
+ end
65
+ end
66
+ end
67
+ end
68
+
31
69
  describe '#foss_only_retrieve' do
32
70
  it 'should fail without foss_platforms' do
33
71
  allow(Pkg::Config).to receive(:foss_platforms).and_return(nil)
@@ -21,7 +21,16 @@ namespace :pl do
21
21
  remote_repo = Pkg::Util::Net.remote_bootstrap(signing_server, 'HEAD', nil, signing_bundle)
22
22
  build_params = Pkg::Util::Net.remote_buildparams(signing_server, Pkg::Config)
23
23
  Pkg::Util::Net.rsync_to('repos', signing_server, remote_repo)
24
- Pkg::Util::Net.remote_ssh_cmd(signing_server, "cd #{remote_repo} ; source /usr/local/rvm/scripts/rvm; rvm use ruby-2.3.1; bundle install; bundle exec rake pl:jenkins:sign_repos GPG_KEY=#{Pkg::Util::Gpg.key} PARAMS_FILE=#{build_params}")
24
+ rake_command = <<-DOC
25
+ cd #{remote_repo} ;
26
+ bundle_prefix= ;
27
+ if [[ -r Gemfile ]]; then
28
+ source /usr/local/rvm/scripts/rvm; rvm use ruby-2.3.1; bundle install --path .bundle/gems;
29
+ bundle_prefix='bundle exec';
30
+ fi ;
31
+ $bundle_prefix rake pl:jenkins:sign_repos GPG_KEY=#{Pkg::Util::Gpg.key} PARAMS_FILE=#{build_params}
32
+ DOC
33
+ Pkg::Util::Net.remote_ssh_cmd(signing_server, rake_command)
25
34
  Pkg::Util::Net.rsync_from("#{remote_repo}/repos/", signing_server, target)
26
35
  Pkg::Util::Net.remote_ssh_cmd(signing_server, "rm -rf #{remote_repo}")
27
36
  Pkg::Util::Net.remote_ssh_cmd(signing_server, "rm #{build_params}")
data/tasks/sign.rake CHANGED
@@ -216,7 +216,16 @@ namespace :pl do
216
216
  remote_repo = Pkg::Util::Net.remote_bootstrap(Pkg::Config.signing_server, 'HEAD', nil, signing_bundle)
217
217
  build_params = Pkg::Util::Net.remote_buildparams(Pkg::Config.signing_server, Pkg::Config)
218
218
  Pkg::Util::Net.rsync_to('pkg', Pkg::Config.signing_server, remote_repo)
219
- Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.signing_server, "cd #{remote_repo} ; source /usr/local/rvm/scripts/rvm; rvm use ruby-2.3.1; bundle install; bundle exec rake #{sign_tasks.join(' ')} PARAMS_FILE=#{build_params}")
219
+ rake_command = <<-DOC
220
+ cd #{remote_repo} ;
221
+ bundle_prefix= ;
222
+ if [[ -r Gemfile ]]; then
223
+ source /usr/local/rvm/scripts/rvm; rvm use ruby-2.3.1; bundle install --path .bundle/gems;
224
+ bundle_prefix='bundle exec';
225
+ fi ;
226
+ $bundle_prefix rake #{sign_tasks.join(' ')} PARAMS_FILE=#{build_params}
227
+ DOC
228
+ Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.signing_server, rake_command)
220
229
  Pkg::Util::Net.rsync_from("#{remote_repo}/pkg/", Pkg::Config.signing_server, "pkg/")
221
230
  Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.signing_server, "rm -rf #{remote_repo}")
222
231
  Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.signing_server, "rm #{build_params}")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: packaging
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.99.1
4
+ version: 0.99.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet Labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-06 00:00:00.000000000 Z
11
+ date: 2018-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec