packaging 0.99.75 → 0.99.76

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
  SHA256:
3
- metadata.gz: d4eba143d4627b1c6ce1eb694894a79987fb4c9eb169a8de3dfe756c037f2cfd
4
- data.tar.gz: fc772076ec4a28f57e2a99afb51a29ecba0d20b6b0eea0d32d16f43575f8c8d4
3
+ metadata.gz: 0d737ac46704906a2bc986128797b3db649dd3e35e1432f2a98f362da67ffa56
4
+ data.tar.gz: 7a1ae857ec7a92940499a60c9d649f5e5e40fd8f2340aa95d2751f0de29d9fbd
5
5
  SHA512:
6
- metadata.gz: 5e6b6a56070e12ea898725f030d2cf95b6e04f6ac329f6dab38a20ab9aa765a3a7667f6967373dbde8cf8686403784ad9ca4e49bc83923e260a7c9517e457329
7
- data.tar.gz: 5a3cadefed6983b5bcacf0f2abb117b8f2c5aa829dc8567a041b4e4b679d1489d8a2badb80a1c7c1b0a51cbda94ad07d8f00d9378dcaca9ab02b4cd831aeab2f
6
+ metadata.gz: cacbbdc7c63c443a6a6bb6c0bc7f77367343b22b8356c4d99c00fe67a1fd448af0c7e0647d616ec533d1cb1cdfb6412fbff953bfb6926dbb4a06911d08da20df
7
+ data.tar.gz: 39ada32cc8dde4df7d661d00807ba937667338278191391ec534c98423228c594a49e2c74bedd10e9c8bd18601dae6bdff54804d48f2e255bc995b198bef4c13
data/README.md CHANGED
@@ -404,7 +404,7 @@ deb_build_mirrors:
404
404
  # Who is packaging. Turns up in various packaging artifacts
405
405
  packager: 'puppetlabs'
406
406
  # GPG key ID of the signer
407
- gpg_key: '7F438280EF8D349F'
407
+ gpg_key: '4528B6CD9E61EF26'
408
408
  # Whether to require tarball signing as a prerequisite of other package building
409
409
  sign_tar: false
410
410
  # a space separated list of mock configs. These are the rpm distributions to package for. If a noarch package, only one arch of each is needed.
@@ -6,6 +6,7 @@ module Pkg
6
6
  #
7
7
  class Config
8
8
  require 'packaging/config/params.rb'
9
+ require 'packaging/config/validations.rb'
9
10
  require 'yaml'
10
11
 
11
12
  class << self
@@ -389,6 +390,31 @@ module Pkg
389
390
  end
390
391
  end
391
392
 
393
+ ##
394
+ # Ask for validation of BUILD_PARAMS
395
+ #
396
+ # Issued as warnings initially but the intent is to turn this into
397
+ # a failure.
398
+ #
399
+ def perform_validations
400
+ error_count = 0
401
+ Pkg::Params::VALIDATIONS.each do |v|
402
+ variable_name = v[:var]
403
+ variable_value = self.instance_variable_get("@#{v[:var]}")
404
+ validations = v[:validations]
405
+ validations.each do |validation|
406
+ unless Pkg::ConfigValidations.send(validation, variable_value)
407
+ warn "Warning: variable \"#{variable_name}\" failed validation \"#{validation}\""
408
+ error_count += 1
409
+ end
410
+ end
411
+ end
412
+
413
+ if error_count != 0
414
+ warn "Warning: #{error_count} validation failure(s)."
415
+ end
416
+ end
417
+
392
418
  def string_to_array(str)
393
419
  delimiters = /[,\s;]/
394
420
  return str if str.respond_to?('each')
@@ -363,6 +363,7 @@ module Pkg::Params
363
363
  { :oldvar => :yum_host, :newvar => :tar_host },
364
364
  ]
365
365
 
366
+
366
367
  # These are variables that we have deprecated. If they are encountered in a
367
368
  # project's config, we issue deprecations for them.
368
369
  #
@@ -373,4 +374,14 @@ module Pkg::Params
373
374
  { :var => :gpg_name, :message => "
374
375
  DEPRECATED, 29-Jul-2014: 'gpg_name' has been replaced with 'gpg_key'.
375
376
  Please update this field in your build_defaults.yaml" }]
377
+
378
+ # Provide an open-ended template for validating BUILD_PARAMS.
379
+ #
380
+ # Each validatation contains the variable name as ':var' and a list of validations it
381
+ # must pass from the Pkg::Params::Validations class.
382
+ #
383
+ VALIDATIONS = [
384
+ { :var => :project, :validations => [:not_empty?] }
385
+ ]
386
+
376
387
  end
@@ -0,0 +1,13 @@
1
+ module Pkg
2
+ class ConfigValidations
3
+
4
+ class << self
5
+
6
+ # As a validation, this one is kindof lame but is intended as a seed pattern for possibly
7
+ # more robust ones.
8
+ def not_empty?(value)
9
+ value.to_s.empty? ? false : true
10
+ end
11
+ end
12
+ end
13
+ end
@@ -322,7 +322,8 @@ module Pkg::Paths
322
322
  if %w(puppet7 puppet7-nightly
323
323
  puppet6 puppet6-nightly
324
324
  puppet5 puppet5-nightly
325
- puppet).include? repo_name
325
+ puppet puppet-nightly
326
+ puppet-tools).include? repo_name
326
327
  return File.join(remote_repo_path, 'pool', code_name, repo_name, project[0], project)
327
328
  end
328
329
 
@@ -100,7 +100,7 @@ module Pkg
100
100
  repo: true,
101
101
  },
102
102
  '8' => {
103
- architectures: ['x86_64', 'aarch64'],
103
+ architectures: ['x86_64', 'ppc64le', 'aarch64'],
104
104
  source_architecture: 'SRPMS',
105
105
  package_format: 'rpm',
106
106
  source_package_formats: ['src.rpm'],
@@ -71,9 +71,8 @@ for msipath in #{msis.join(" ")}; do
71
71
  echo "$msi is already signed, skipping . . ." ;
72
72
  else
73
73
  tries=5
74
- sha1Servers=(http://timestamp.verisign.com/scripts/timstamp.dll
75
- http://timestamp.globalsign.com/scripts/timstamp.dll
76
- http://www.startssl.com/timestamp)
74
+ sha1Servers=(http://timestamp.digicert.com/sha1/timestamp
75
+ http://timestamp.comodoca.com/authenticode)
77
76
  for timeserver in "${sha1Servers[@]}"; do
78
77
  for ((try=1; try<=$tries; try++)) do
79
78
  ret=$(/cygdrive/c/tools/osslsigncode-fork/osslsigncode.exe sign \
@@ -17,7 +17,7 @@ describe "Pkg::Util::Git_tag" do
17
17
 
18
18
  context "branch?" do
19
19
  it "sets ref type as a branch when passed a branch" do
20
- git_tag = Pkg::Util::Git_tag.new("git://github.com/puppetlabs/leatherman.git", "master")
20
+ git_tag = Pkg::Util::Git_tag.new("git://github.com/puppetlabs/leatherman.git", "main")
21
21
  expect(git_tag.branch?).to eq(true)
22
22
  end
23
23
  end
data/tasks/config.rake CHANGED
@@ -6,6 +6,11 @@ namespace :config do
6
6
  end
7
7
  end
8
8
 
9
+ desc "validate Pkg::Config values for this repo"
10
+ task :validate do
11
+ Pkg::Config.perform_validations
12
+ end
13
+
9
14
  task :print_hosts => 'pl:fetch' do
10
15
  Pkg::Util.filter_configs('host').each do |key, value|
11
16
  puts "#{key}: #{value}"
data/tasks/fetch.rake CHANGED
@@ -30,28 +30,31 @@ namespace :pl do
30
30
  task :fetch do
31
31
  # Remove .packaging directory from old-style extras loading
32
32
  rm_rf "#{ENV['HOME']}/.packaging" if File.directory?("#{ENV['HOME']}/.packaging")
33
+
33
34
  # Touch the .packaging file which is allows packaging to present remote tasks
34
35
  touch "#{ENV['HOME']}/.packaging"
35
36
 
36
37
  begin
37
- temp_build_data_dir = Pkg::Util::File.mktemp
38
- %x(git clone #{data_repo} #{temp_build_data_dir})
39
- if $?.success?
40
- Dir.chdir(temp_build_data_dir) do
41
- [team_data_branch, project_data_branch].each do |branch|
42
- %x(git checkout #{branch})
43
- if $?.success?
44
- Pkg::Util::RakeUtils.invoke_task("pl:load_extras", temp_build_data_dir)
45
- else
46
- warn "Unable to load build_defaults from branch '#{branch}' in '#{data_repo}'. Skipping."
47
- end
38
+ build_data_directory = Pkg::Util::File.mktemp
39
+ %x(git clone #{data_repo} #{build_data_directory})
40
+ unless $?.success?
41
+ fail 'Error: could not fetch the build-data repo. Maybe you do not have the correct permissions?'
42
+ end
43
+
44
+ Dir.chdir(build_data_directory) do
45
+ [team_data_branch, project_data_branch].each do |branch|
46
+ %x(git checkout #{branch})
47
+ unless $?.success?
48
+ warn "Warning: no build_defaults found in branch '#{branch}' of '#{data_repo}'. Skipping."
49
+ next
48
50
  end
51
+ Pkg::Util::RakeUtils.invoke_task('pl:load_extras', build_data_directory)
49
52
  end
50
- else
51
- fail "There was an error attempting to fetch the build-data repo. Maybe you do not have the correct permissions?"
52
53
  end
53
54
  ensure
54
- rm_rf temp_build_data_dir
55
+ rm_rf build_data_directory
55
56
  end
57
+
58
+ Pkg::Util::RakeUtils.invoke_task('config:validate')
56
59
  end
57
60
  end
data/tasks/gem.rake CHANGED
@@ -150,20 +150,10 @@ namespace :package do
150
150
  Pkg::Config.gemversion = Pkg::Util::Version.extended_dot_version
151
151
  package_gem
152
152
  end
153
-
154
- # PA-3356: temporary task to ship puppet 7 nightly gem
155
- # TODO: PA-3358 - remove when puppet 7 is officialy out
156
- task :puppet_7_nightly_gem => ["clean"] do
157
- Pkg::Config.gemversion = Pkg::Util::Version.extended_dot_version.gsub(/6\.\d+\.\d+/, '7.0.0')
158
- package_gem
159
- end
160
153
  end
161
154
 
162
155
  # An alias task to simplify our remote logic in jenkins.rake
163
156
  namespace :pl do
164
157
  task :gem => "package:gem"
165
158
  task :nightly_gem => "package:nightly_gem"
166
- # PA-3356: temporary task to ship puppet 7 nightly gem
167
- # TODO: PA-3358 - remove when puppet 7 is officialy out
168
- task :puppet_7_nightly_gem => "package:puppet_7_nightly_gem"
169
159
  end
data/tasks/ship.rake CHANGED
@@ -265,25 +265,6 @@ namespace :pl do
265
265
 
266
266
  Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.gem_host, command)
267
267
  end
268
-
269
- # PA-3356: temporary task to link puppet 7 nightly gem
270
- # TODO: PA-3358 - remove when puppet 7 is officialy out
271
- desc "Remotely link puppet 7 nightly shipped gems to latest versions on #{Pkg::Config.gem_host}"
272
- task link_puppet_7_nightly_shipped_gems_to_latest: 'pl:fetch' do
273
- Pkg::Config.gemversion = Pkg::Util::Version.extended_dot_version.gsub(/6\.\d+\.\d+/, '7.0.0')
274
-
275
- remote_path = Pkg::Config.nonfinal_gem_path
276
- gems = FileList['pkg/*.gem'].map! { |path| path.gsub!('pkg/', '') }
277
- command = %(cd #{remote_path}; )
278
-
279
- command += gems.map! do |gem_name|
280
- %(sudo ln -sf #{gem_name} #{gem_name.gsub(Pkg::Config.gemversion, 'latest')})
281
- end.join(';')
282
-
283
- command += %(; sync)
284
-
285
- Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.gem_host, command)
286
- end
287
268
  end
288
269
 
289
270
  desc "Ship mocked rpms to #{Pkg::Config.yum_staging_server}"
@@ -463,6 +444,16 @@ namespace :pl do
463
444
  end
464
445
  end
465
446
 
447
+ desc 'Create the rolling repo links'
448
+ task create_repo_links: 'pl:fetch' do
449
+ Pkg::Util::Ship.create_rolling_repo_links
450
+ end
451
+
452
+ desc 'Create rolling repo links for nightlies'
453
+ task create_nightly_repo_links: 'pl:fetch' do
454
+ Pkg::Util::Ship.create_rolling_repo_links(true)
455
+ end
456
+
466
457
  desc 'Test out the ship requirements'
467
458
  task ship_check: 'pl:fetch' do
468
459
  errs = []
@@ -536,15 +527,6 @@ namespace :pl do
536
527
  end
537
528
  end
538
529
 
539
- desc 'Create the rolling repo links'
540
- task create_repo_links: 'pl:fetch' do
541
- Pkg::Util::Ship.create_rolling_repo_links
542
- end
543
-
544
- desc 'Create rolling repo links for nightlies'
545
- task create_nightly_repo_links: 'pl:fetch' do
546
- Pkg::Util::Ship.create_rolling_repo_links(true)
547
- end
548
530
  end
549
531
 
550
532
  # It is odd to namespace this ship task under :jenkins, but this task is
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.75
4
+ version: 0.99.76
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet Labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-08 00:00:00.000000000 Z
11
+ date: 2021-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -124,6 +124,7 @@ files:
124
124
  - lib/packaging/artifactory/extensions.rb
125
125
  - lib/packaging/config.rb
126
126
  - lib/packaging/config/params.rb
127
+ - lib/packaging/config/validations.rb
127
128
  - lib/packaging/deb.rb
128
129
  - lib/packaging/deb/repo.rb
129
130
  - lib/packaging/gem.rb
@@ -260,27 +261,27 @@ specification_version: 4
260
261
  summary: Puppet Labs' packaging automation
261
262
  test_files:
262
263
  - spec/lib/packaging_spec.rb
263
- - spec/lib/packaging/rpm/repo_spec.rb
264
- - spec/lib/packaging/paths_spec.rb
264
+ - spec/lib/packaging/sign_spec.rb
265
265
  - spec/lib/packaging/deb/repo_spec.rb
266
+ - spec/lib/packaging/retrieve_spec.rb
267
+ - spec/lib/packaging/paths_spec.rb
268
+ - spec/lib/packaging/platforms_spec.rb
269
+ - spec/lib/packaging/rpm/repo_spec.rb
270
+ - spec/lib/packaging/gem_spec.rb
271
+ - spec/lib/packaging/deb_spec.rb
272
+ - spec/lib/packaging/repo_spec.rb
273
+ - spec/lib/packaging/config_spec.rb
274
+ - spec/lib/packaging/util/misc_spec.rb
275
+ - spec/lib/packaging/util/execution_spec.rb
266
276
  - spec/lib/packaging/util/gpg_spec.rb
267
277
  - spec/lib/packaging/util/os_spec.rb
268
- - spec/lib/packaging/util/file_spec.rb
269
- - spec/lib/packaging/util/ship_spec.rb
278
+ - spec/lib/packaging/util/version_spec.rb
270
279
  - spec/lib/packaging/util/git_spec.rb
271
- - spec/lib/packaging/util/execution_spec.rb
272
- - spec/lib/packaging/util/misc_spec.rb
280
+ - spec/lib/packaging/util/net_spec.rb
273
281
  - spec/lib/packaging/util/rake_utils_spec.rb
274
- - spec/lib/packaging/util/version_spec.rb
275
- - spec/lib/packaging/util/git_tag_spec.rb
276
282
  - spec/lib/packaging/util/jenkins_spec.rb
277
- - spec/lib/packaging/util/net_spec.rb
278
- - spec/lib/packaging/deb_spec.rb
279
- - spec/lib/packaging/config_spec.rb
280
- - spec/lib/packaging/artifactory_spec.rb
281
- - spec/lib/packaging/gem_spec.rb
283
+ - spec/lib/packaging/util/git_tag_spec.rb
284
+ - spec/lib/packaging/util/ship_spec.rb
285
+ - spec/lib/packaging/util/file_spec.rb
282
286
  - spec/lib/packaging/tar_spec.rb
283
- - spec/lib/packaging/sign_spec.rb
284
- - spec/lib/packaging/repo_spec.rb
285
- - spec/lib/packaging/platforms_spec.rb
286
- - spec/lib/packaging/retrieve_spec.rb
287
+ - spec/lib/packaging/artifactory_spec.rb