packaging 0.99.42 → 0.99.43

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: fd24a8988e84d0bda7452b64162e7d6e884b92bd6d5f4ceccc83483f62383da2
4
- data.tar.gz: fa19cd31ea261e6e3ff17762f17e869f6098c1a07714faafa582381225953c7f
3
+ metadata.gz: 8e86d7fe08b68d5d7dae0c81c719c82cfe1d4fab9eb766cd0a92e4c9bf2e6ad5
4
+ data.tar.gz: dcb6ecf3b11dec313a80239ba0d6e8b2e30cb2ad99c3ce1033e1cb37e82ef9cf
5
5
  SHA512:
6
- metadata.gz: 8346344afaedd5e10b1d3eab98b0e3bc6a4b894ca90990f7f1dd6a595c373c8f7bd383d545a2441cacb5bb69dc03a9920818352e740c1085381fcebd6693b9ad
7
- data.tar.gz: d0b4ae82cf80a0658df1165f2eeb7375b697a335618ff1cc312394d617e1422f47a5e7abf41edd60d0cdb66e2ccda33447c30a710de94c7bce332c6d5743d32a
6
+ metadata.gz: 362e996c395b9d1932711854489dec6075184f554b9f22465bda917e8b620d2a474a89d62c9abcb30c575042ea1ad500d0c06e78a001e4766efd0748add89f90
7
+ data.tar.gz: a74993a3a525c777649c4562c40a6c53b9b0f3f0c6f9b23412c0c4eed6ed8903f8be102ef0b5b3fa25df7c575e4392413b6efe8138e860113a05f5bb777f3b4a
@@ -1,7 +1,69 @@
1
+ require 'artifactory'
1
2
  require 'uri'
2
3
  require 'open-uri'
3
4
  require 'digest'
4
5
 
6
+ #
7
+ # [eric.griswold] This is unfortunate. The 'pattern_search' class method really does belong in
8
+ # the Artifactory gem. However, because of some of Chef's social policies,
9
+ # I am unwilling to contribute this code there. If that changes, I'll submit a PR. Until
10
+ # then, it'll live here.
11
+ #
12
+ module Artifactory
13
+ class Resource::Artifact
14
+ #
15
+ # Search for an artifact in a repo using an Ant-like pattern.
16
+ # Unlike many Artifactory searches, this one is restricted to a single
17
+ # repository.
18
+ #
19
+ # @example Search in a repository named 'foo_local' for an artifact in a directory containing
20
+ # the word "recent", named "artifact[0-9].txt"
21
+ # Artifact.pattern_search(pattern: '*recent*/artifact[0-9].txt',
22
+ # repo: 'foo_local')
23
+ #
24
+ # @param [Hash] options
25
+ # A hash of options, as follows:
26
+ #
27
+ # @option options [Artifactory::Client] :client
28
+ # the client object to make the request with
29
+ # @option options [String] :pattern
30
+ # the Ant-like pattern to use for finding artifacts within the repos. Note that the
31
+ # Ant pattern '**' is barred in this case by JFrog.
32
+ # @option options [String] :repo
33
+ # the repo to search
34
+ #
35
+ # @return [Array<Resource::Artifact>]
36
+ # a list of artifacts that match the query
37
+ #
38
+ def self.pattern_search(options = {})
39
+ client = extract_client!(options)
40
+ params = Util.slice(options, :pattern, :repo)
41
+ pattern_search_parameter = { :pattern => "#{params[:repo]}:#{params[:pattern]}" }
42
+ response = client.get('/api/search/pattern', pattern_search_parameter)
43
+ return [] if response['files'].nil? || response['files'].empty?
44
+
45
+ # A typical response:
46
+ # {
47
+ # "repoUri"=>"https:<artifactory endpoint>/<repo>",
48
+ # "sourcePattern"=>"<repo>:<provided search pattern>",
49
+ # "files"=>[<filename that matched pattern>, ...]
50
+ # }
51
+ #
52
+ # Inserting '/api/storage' before the repo makes the 'from_url' call work correctly.
53
+ #
54
+ repo_uri = response['repoUri']
55
+ unless repo_uri.include?('/api/storage/')
56
+ # rubocop:disable Style/PercentLiteralDelimiters
57
+ repo_uri.sub!(%r(/#{params[:repo]}$), "/api/storage/#{params[:repo]}")
58
+ end
59
+ response['files'].map do |file_path|
60
+ from_url("#{repo_uri}/#{file_path}", client: client)
61
+ end
62
+ end
63
+ end
64
+ end
65
+
66
+
5
67
  module Pkg
6
68
 
7
69
  # The Artifactory class
@@ -10,6 +72,11 @@ module Pkg
10
72
  # artifacts to the repos, and to retrieve them back from the repos.
11
73
  class ManageArtifactory
12
74
 
75
+ # The Artifactory property that the artifactCleanup user plugin
76
+ # {https://github.com/jfrog/artifactory-user-plugins/tree/master/cleanup/artifactCleanup}
77
+ # uses to tell it to not clean a particular artifact
78
+ ARTIFACTORY_CLEANUP_SKIP_PROPERTY = 'cleanup.skip'
79
+
13
80
  DEFAULT_REPO_TYPE = 'generic'
14
81
  DEFAULT_REPO_BASE = 'development'
15
82
 
@@ -24,8 +91,6 @@ module Pkg
24
91
  # @option :repo_base [String] The base of all repos, set for consistency.
25
92
  # This currently defaults to 'development'
26
93
  def initialize(project, project_version, opts = {})
27
- require 'artifactory'
28
-
29
94
  @artifactory_uri = opts[:artifactory_uri] || 'https://artifactory.delivery.puppetlabs.net/artifactory'
30
95
  @repo_base = opts[:repo_base] || DEFAULT_REPO_BASE
31
96
 
@@ -297,17 +362,20 @@ module Pkg
297
362
  # get the artifact name
298
363
  artifact_names = all_package_names(yaml_data[:platform_data], platform_tag)
299
364
  artifact_names.each do |artifact_name|
300
- artifact_to_promote = Artifactory::Resource::Artifact.search(name: artifact_name, :artifactory_uri => @artifactory_uri)
365
+ artifact_search_results = Artifactory::Resource::Artifact.search(
366
+ name: artifact_name, :artifactory_uri => @artifactory_uri)
301
367
 
302
- if artifact_to_promote.empty?
368
+ if artifact_search_results.empty?
303
369
  raise "Error: could not find PKG=#{pkg} at REF=#{git_ref} for #{platform_tag}"
304
370
  end
371
+ artifact_to_promote = artifact_search_results[0]
305
372
 
306
373
  # This makes an assumption that we're using some consistent repo names
307
374
  # but need to either prepend 'rpm_' or 'debian_' based on package type
308
- if File.extname(artifact_name) == '.rpm'
375
+ case File.extname(artifact_name)
376
+ when '.rpm'
309
377
  promotion_path = "rpm_#{repository}/#{platform_tag}/#{artifact_name}"
310
- elsif File.extname(artifact_name) == '.deb'
378
+ when '.deb'
311
379
  promotion_path = "debian_#{repository}/#{platform_tag}/#{artifact_name}"
312
380
  properties = { 'deb.component' => debian_component } unless debian_component.nil?
313
381
  else
@@ -315,8 +383,9 @@ module Pkg
315
383
  end
316
384
 
317
385
  begin
318
- puts "promoting #{artifact_name} to #{promotion_path}"
319
- artifact_to_promote[0].copy(promotion_path)
386
+ source_path = artifact_to_promote.download_uri.sub(@artifactory_uri, '')
387
+ puts "promoting #{artifact_name} from #{source_path} to #{promotion_path}"
388
+ artifact_to_promote.copy(promotion_path)
320
389
  unless properties.nil?
321
390
  artifacts = Artifactory::Resource::Artifact.search(name: artifact_name, :artifactory_uri => @artifactory_uri)
322
391
  promoted_artifact = artifacts.select { |artifact| artifact.download_uri =~ %r{#{promotion_path}} }.first
@@ -356,37 +425,81 @@ module Pkg
356
425
  end
357
426
 
358
427
  # Ship PE tarballs to specified artifactory repo and paths
359
- # @param tarball_path [String] the path of the tarballs to ship
428
+ # @param local_tarball_directory [String] the local directory containing the tarballs
360
429
  # @param target_repo [String] the artifactory repo to ship the tarballs to
361
- # @param ship_paths [Array] the artifactory path(s) to ship the tarballs to within the target_repo
362
- def ship_pe_tarballs(tarball_path, target_repo, ship_paths)
430
+ # @param ship_paths [Array] the artifactory path(s) to ship the tarballs to within
431
+ # the target_repo
432
+ def ship_pe_tarballs(local_tarball_directory, target_repo, ship_paths)
363
433
  check_authorization
364
- Dir.foreach("#{tarball_path}/") do |pe_tarball|
365
- unless pe_tarball == '.' || pe_tarball == ".."
366
- ship_paths.each do |path|
367
- begin
368
- puts "Uploading #{pe_tarball} to #{target_repo}/#{path}... "
369
- artifact = Artifactory::Resource::Artifact.new(local_path: "#{tarball_path}/#{pe_tarball}")
370
- artifact.upload(target_repo, "/#{path}/#{pe_tarball}")
371
- rescue Errno::EPIPE
372
- STDERR.puts "Error: Could not upload #{pe_tarball} to #{path}"
434
+ ship_paths.each do |path|
435
+ unset_cleanup_skip_on_artifacts(target_repo, path)
436
+ Dir.foreach(local_tarball_directory) do |pe_tarball|
437
+ next if pe_tarball == '.' || pe_tarball == ".."
438
+ begin
439
+ puts "Uploading #{pe_tarball} to #{target_repo}/#{path}#{pe_tarball}"
440
+ artifact = Artifactory::Resource::Artifact.new(
441
+ local_path: "#{local_tarball_directory}/#{pe_tarball}")
442
+ uploaded_artifact = artifact.upload(target_repo, "#{path}#{pe_tarball}")
443
+ # The Artifactory gem property setter only works when '/api/storage' is used in
444
+ # the 'uri' field.
445
+ # Strangely, the above Artifactory::Resource::Artifact.new gives us the raw URI.
446
+ # Therefore we are forced to do some path surgery, inserting
447
+ # '/api/storage' before "/#{target_repo}" to make the property setting work.
448
+ storage_artifact = uploaded_artifact
449
+ unless storage_artifact.uri.include?("/api/storage")
450
+ storage_artifact.uri = storage_artifact.uri.sub(
451
+ "/#{target_repo}",
452
+ "/api/storage/#{target_repo}")
373
453
  end
454
+ storage_artifact.properties(ARTIFACTORY_CLEANUP_SKIP_PROPERTY => true)
455
+ rescue Errno::EPIPE
456
+ ## [eric.griswold] maybe this should be fatal?
457
+ STDERR.puts "Warning: Could not upload #{pe_tarball} to #{target_repo}/#{path}. Skipping."
458
+ next
374
459
  end
375
460
  end
376
461
  end
377
462
  end
378
463
 
379
- # Update LATEST file with latest PE build
380
- # @param latest_file [String] name of latest file to ship
381
- # @param target_repo [String] repo on artifactory to ship latest file to
382
- # @param path [String] path on target_repo to latest file
383
- def update_latest_file(latest_file, target_repo, path)
464
+ # Upload file to Artifactory
465
+ # @param local_path [String] local path to file to upload
466
+ # @param target_repo [String] repo on artifactory to upload to
467
+ # @param target_path [String] path within target_repo to upload to
468
+ def upload_file(local_path, target_repo, target_path)
469
+ fail "Error: Couldn't find file at #{local_path}." unless File.exist? local_path
384
470
  check_authorization
385
- artifact = Artifactory::Resource::Artifact.new(local_path: latest_file)
471
+ artifact = Artifactory::Resource::Artifact.new(local_path: local_path)
472
+ full_upload_path = File.join(target_path, File.basename(local_path))
386
473
  begin
387
- artifact.upload(target_repo, "/#{path}/#{latest_file}")
388
- rescue Errno::ENOENT
389
- STDERR.puts "Error: Could not upload #{latest_file} file. Are you sure it was created?"
474
+ puts "Uploading #{local_path} to #{target_repo}/#{full_upload_path} . . ."
475
+ artifact.upload(target_repo, full_upload_path)
476
+ rescue Artifactory::Error::HTTPError => e
477
+ fail "Error: Upload failed. Ensure path #{target_path} exists in the #{target_repo} repository."
478
+ end
479
+ end
480
+
481
+ # Clear the ARTIFACTORY_CLEANUP_SKIP_PROPERTY on all artifacts in
482
+ # a specified directory in a given Artifactory repo that match
483
+ # /<directory>/*.tar. Use this before uploading newer tarballs to maintain
484
+ # 'cleanup.skip' on the latest tarballs only.
485
+ #
486
+ # @param repo [String] Artifactory repository that contains the specified directory
487
+ # @param directory [String] Artifactory directory in repo containing the artifacts from which to
488
+ # set the 'cleanup.skip' property setting to false
489
+ def unset_cleanup_skip_on_artifacts(repo, directory)
490
+ artifacts_with_cleanup_skip = Artifactory::Resource::Artifact.property_search(
491
+ ARTIFACTORY_CLEANUP_SKIP_PROPERTY => true,
492
+ "repos" => repo
493
+ )
494
+
495
+ # For the upcoming directory check, make sure we know where our trailing slashes are.
496
+ directory_no_trailing_slashes = directory.sub(/(\/)+$/, '')
497
+
498
+ # For all tarball artifacts in #{directory} that have the Artifactory property
499
+ # 'cleanup.skip' set to true, set it to 'false'
500
+ artifacts_with_cleanup_skip.each do |artifact|
501
+ next unless artifact.uri.include?("/#{directory_no_trailing_slashes}/")
502
+ artifact.properties(ARTIFACTORY_CLEANUP_SKIP_PROPERTY => false)
390
503
  end
391
504
  end
392
505
 
@@ -404,6 +517,87 @@ module Pkg
404
517
  end
405
518
  end
406
519
 
520
+ # Download final pe tarballs to local path based on name, repo, and path on artifactory
521
+ # @param pe_version [String] pe final tag
522
+ # @param repo [String] repo the tarballs live
523
+ # @param remote_path [String] path to tarballs in the repo
524
+ # @param local_path [String] local path to download tarballs to
525
+ def download_final_pe_tarballs(pe_version, repo, remote_path, local_path)
526
+ check_authorization
527
+ artifacts = Artifactory::Resource::Artifact.search(name: pe_version, repos: repo)
528
+ artifacts.each do |artifact|
529
+ next unless artifact.download_uri.include? remote_path
530
+ next if artifact.download_uri.include? "-rc"
531
+ artifact.download(local_path)
532
+ end
533
+ end
534
+
535
+ # Download beta pe tarballs to local path based on tag, repo, and path on artifactory
536
+ # @param beta_tag [String] rc tag of beta release ex. 2019.2.0-rc10
537
+ # @param repo [String] repo the tarballs live
538
+ # @param remote_path [String] path to tarballs in the repo
539
+ # @param local_path [String] local path to download tarballs to
540
+ def download_beta_pe_tarballs(beta_tag, repo, remote_path, local_path)
541
+ check_authorization
542
+ pattern = "#{remote_path}/*-#{beta_tag}-*"
543
+ artifacts = Artifactory::Resource::Artifact.pattern_search(repo: repo, pattern: pattern)
544
+ artifacts.each do |artifact|
545
+ artifact.download(local_path)
546
+ end
547
+ end
548
+
549
+ # When we ship a new PE release we copy final tarballs to archives/releases
550
+ # @param pe_version [String] pe final tag
551
+ # @param repo [String] repo the tarballs live
552
+ # @param remote_path [String] path to tarballs in the repo
553
+ # @param target_path [String] path copy tarballs to, assumes same repo
554
+ def copy_final_pe_tarballs(pe_version, repo, remote_path, target_path)
555
+ check_authorization
556
+ final_tarballs = Artifactory::Resource::Artifact.search(name: pe_version, repos: repo)
557
+ final_tarballs.each do |artifact|
558
+ next unless artifact.download_uri.include? remote_path
559
+ next if artifact.download_uri.include? "-rc"
560
+ artifact.copy("#{repo}/#{target_path}")
561
+ end
562
+ end
563
+
564
+ # When we cut a new PE branch, we need to copy the pe components into <pe_version>/{repos,feature,release}/<platform>
565
+ # @param manifest [File] JSON file containing information about what packages to download and the corresponding md5sums
566
+ # @param target_path [String] path on artifactory to copy components to, e.g. <pe_version>/release
567
+ def populate_pe_repos(manifest, target_path)
568
+ check_authorization
569
+ manifest.each do |dist, packages|
570
+ puts "Copying #{dist} packages..."
571
+ packages.each do |name, info|
572
+ artifact = Artifactory::Resource::Artifact.checksum_search(md5: "#{info["md5"]}", repos: ["rpm_enterprise__local", "debian_enterprise__local"]).first
573
+ if artifact.nil?
574
+ raise "Error: what the hell, could not find package #{info["filename"]} with md5sum #{info["md5"]}"
575
+ end
576
+ begin
577
+ artifact_target_path = "#{artifact.repo}/#{target_path}/#{dist}/#{info["filename"]}"
578
+ puts "Copying #{artifact.download_uri} to #{artifact_target_path}"
579
+ artifact.copy(artifact_target_path)
580
+ rescue Artifactory::Error::HTTPError
581
+ STDERR.puts "Could not copy #{artifact_target_path}. Source and destination are the same. Skipping..."
582
+ end
583
+ end
584
+ end
585
+ end
586
+
587
+ # Remove all artifacts in repo based on pattern, used when we purge all artifacts in release/ after PE release
588
+ # @param repos [Array] repos that we want to search for artifacts in
589
+ # @param pattern [String] pattern for artifacts that should be deleted ex. `2019.1/release/*/*`
590
+ def teardown_repo(repos, pattern)
591
+ check_authorization
592
+ repos.each do |repo|
593
+ artifacts = Artifactory::Resource::Artifact.pattern_search(repo: repo, pattern: pattern)
594
+ artifacts.each do |artifact|
595
+ puts "Deleting #{artifact.download_uri}"
596
+ artifact.delete
597
+ end
598
+ end
599
+ end
600
+
407
601
  # Remove shipped PE tarballs from artifactory
408
602
  # Used when compose fails, we only want the tarball shipped to artifactory if all platforms succeed
409
603
  # Identify which packages were created and shipped based on md5sum and remove them
@@ -99,7 +99,7 @@ module Pkg
99
99
  # beaker install the msi without having to know any version
100
100
  # information, but we should report the versioned artifact in
101
101
  # platform_data
102
- next if platform == 'windows' && File.basename(artifact) == "#{self.project}-#{arch}.#{package_format}"
102
+ next if platform =~ /^windows.*$/ && File.basename(artifact) == "#{self.project}-#{arch}.#{package_format}"
103
103
 
104
104
  # Sometimes we have source or debug packages. We don't want to save
105
105
  # these paths in favor of the artifact paths.
@@ -25,13 +25,15 @@ module Pkg::Paths
25
25
  # with the artifact and path
26
26
  def tag_from_artifact_path(path)
27
27
  platform = Pkg::Platforms.supported_platforms.find { |p| path =~ /(\/|\.)#{p}[^\.]/ }
28
+ platform = 'windowsfips' if path =~ /windowsfips/
29
+
28
30
  codename = Pkg::Platforms.codenames.find { |c| path =~ /\/#{c}/ }
29
31
 
30
32
  if codename
31
33
  platform, version = Pkg::Platforms.codename_to_platform_version(codename)
32
34
  end
33
35
 
34
- version = '2012' if platform == 'windows'
36
+ version = '2012' if platform =~ /^windows.*$/
35
37
 
36
38
  version ||= Pkg::Platforms.versions_for_platform(platform).find { |v| path =~ /#{platform}(\/|-)?#{v}/ }
37
39
 
@@ -152,7 +154,7 @@ module Pkg::Paths
152
154
  if is_legacy_repo?(repo_name(nonfinal))
153
155
  [File.join(path_prefix, 'windows'), nil]
154
156
  else
155
- [File.join(path_prefix, 'windows', repo_name(nonfinal)), link_name(nonfinal).nil? ? nil : File.join(path_prefix, 'windows', link_name(nonfinal))]
157
+ [File.join(path_prefix, platform, repo_name(nonfinal)), link_name(nonfinal).nil? ? nil : File.join(path_prefix, platform, link_name(nonfinal))]
156
158
  end
157
159
  else
158
160
  raise "Not sure where to find packages with a package format of '#{package_format}'"
@@ -242,7 +244,7 @@ module Pkg::Paths
242
244
  if options[:legacy]
243
245
  File.join('repos', 'windows')
244
246
  else
245
- File.join('repos', 'windows', repo_target)
247
+ File.join('repos', platform, repo_target)
246
248
  end
247
249
  else
248
250
  raise "Not sure what to do with a package format of '#{package_format}'"
@@ -340,6 +340,13 @@ module Pkg
340
340
  repo: false,
341
341
  }
342
342
  },
343
+ 'windowsfips' => {
344
+ '2012' => {
345
+ architectures: ['x64'],
346
+ package_format: 'msi',
347
+ repo: false,
348
+ }
349
+ },
343
350
  }.freeze
344
351
 
345
352
  # @return [Array] An array of Strings, containing all of the supported
@@ -9,7 +9,7 @@ module Pkg::Sign::Msi
9
9
 
10
10
  work_dir = "Windows/Temp/#{Pkg::Util.rand_string}"
11
11
  Pkg::Util::Net.remote_ssh_cmd(ssh_host_string, "mkdir -p C:/#{work_dir}")
12
- msis = Dir.glob("#{target_dir}/windows/**/*.msi")
12
+ msis = Dir.glob("#{target_dir}/windows*/**/*.msi")
13
13
  Pkg::Util::Net.rsync_to(msis.join(" "), rsync_host_string, "/cygdrive/c/#{work_dir}")
14
14
 
15
15
  # Please Note:
@@ -26,6 +26,11 @@ describe 'artifactory.rb' do
26
26
  :repo_config => '',
27
27
  :additional_artifacts => ["./windows/puppet-agent-extras-5.3.1.34-x86.msi"],
28
28
  },
29
+ 'windowsfips-2012-x64' => {
30
+ :artifact => "./windowsfips/puppet-agent-5.3.1.34-x64.msi",
31
+ :repo_config => '',
32
+ :additional_artifacts => ["./windowsfips/puppet-agent-extras-5.3.1.34-x64.msi"],
33
+ },
29
34
  'eos-4-i386' => {
30
35
  :artifact => "./eos/4/PC1/i386/puppet-agent-5.3.1.34.gf65f9ef-1.eos4.i386.swix",
31
36
  :repo_config => '',
@@ -65,6 +70,12 @@ describe 'artifactory.rb' do
65
70
  :package_name => 'path/to/a/windows/package/puppet-agent-5.3.1.34-x86.msi',
66
71
  :all_package_names => ['puppet-agent-5.3.1.34-x86.msi','puppet-agent-extras-5.3.1.34-x86.msi']
67
72
  },
73
+ 'windowsfips-2012-x64' => {
74
+ :toplevel_repo => 'generic',
75
+ :repo_subdirectories => "#{default_repo_name}/#{project}/#{project_version}/windowsfips-x64",
76
+ :package_name => 'path/to/a/windowsfips/package/puppet-agent-5.3.1.34-x64.msi',
77
+ :all_package_names => ['puppet-agent-5.3.1.34-x64.msi','puppet-agent-extras-5.3.1.34-x64.msi']
78
+ },
68
79
  'eos-4-i386' => {
69
80
  :toplevel_repo => 'generic',
70
81
  :repo_subdirectories => "#{default_repo_name}/#{project}/#{project_version}/eos-4-i386",
@@ -232,7 +232,9 @@ describe "Pkg::Config" do
232
232
  "./artifacts/windows/puppet-agent-x64.msi\n" \
233
233
  "./artifacts/windows/puppet-agent-5.3.2-x86.wixpdb\n" \
234
234
  "./artifacts/windows/puppet-agent-5.3.2-x86.msi\n" \
235
- "./artifacts/windows/puppet-agent-5.3.2-x64.msi"
235
+ "./artifacts/windows/puppet-agent-5.3.2-x64.msi\n"\
236
+ "./artifacts/windowsfips/puppet-agent-x64.msi\n" \
237
+ "./artifacts/windowsfips/puppet-agent-5.3.2-x64.msi"
236
238
 
237
239
  solaris_artifacts = \
238
240
  "./artifacts/solaris/11/PC1/puppet-agent@5.3.2,5.11-1.sparc.p5p\n" \
@@ -297,6 +299,7 @@ describe "Pkg::Config" do
297
299
  data = Pkg::Config.platform_data
298
300
  expect(data['windows-2012-x86']).to include(:artifact => './windows/puppet-agent-5.3.2-x86.msi')
299
301
  expect(data['windows-2012-x64']).to include(:artifact => './windows/puppet-agent-5.3.2-x64.msi')
302
+ expect(data['windowsfips-2012-x64']).to include(:artifact => './windowsfips/puppet-agent-5.3.2-x64.msi')
300
303
  end
301
304
 
302
305
  it "should not collect debug packages" do
@@ -19,7 +19,7 @@ describe 'Pkg::Platforms' do
19
19
 
20
20
  describe '#supported_platforms' do
21
21
  it 'should return all supported platforms' do
22
- platforms = ['aix', 'cisco-wrlinux', 'cumulus', 'debian', 'el', 'eos', 'fedora', 'osx', 'redhatfips', 'sles', 'solaris', 'ubuntu', 'windows']
22
+ platforms = ['aix', 'cisco-wrlinux', 'cumulus', 'debian', 'el', 'eos', 'fedora', 'osx', 'redhatfips', 'sles', 'solaris', 'ubuntu', 'windows', 'windowsfips']
23
23
  expect(Pkg::Platforms.supported_platforms).to match_array(platforms)
24
24
  end
25
25
  end
@@ -127,6 +127,7 @@ describe 'Pkg::Platforms' do
127
127
  test_cases = {
128
128
  'debian-9-amd64' => ['debian', '9', 'amd64'],
129
129
  'windows-2012-x86' => ['windows', '2012', 'x86'],
130
+ 'windowsfips-2012-x64' => ['windowsfips', '2012', 'x64'],
130
131
  'el-7-x86_64' => ['el', '7', 'x86_64'],
131
132
  'cisco-wrlinux-7-x86_64' => ['cisco-wrlinux', '7', 'x86_64'],
132
133
  'cisco-wrlinux-7' => ['cisco-wrlinux', '7', ''],
@@ -4,7 +4,9 @@ describe '#Pkg::Util::Ship' do
4
4
  describe '#collect_packages' do
5
5
  msi_pkgs = [
6
6
  'pkg/windows/puppet5/puppet-agent-1.4.1.2904.g8023dd1-x86.msi',
7
- 'pkg/windows/puppet5/puppet-agent-x86.msi'
7
+ 'pkg/windows/puppet5/puppet-agent-x86.msi',
8
+ 'pkg/windowsfips/puppet5/puppet-agent-1.4.1.2904.g8023dd1-x64.msi',
9
+ 'pkg/windowsfips/puppet5/puppet-agent-x64.msi'
8
10
  ]
9
11
  swix_pkgs = [
10
12
  'pkg/eos/puppet5/4/i386/puppet-agent-1.4.1.2904.g8023dd1-1.eos4.i386.swix',
@@ -24,7 +26,13 @@ describe '#Pkg::Util::Ship' do
24
26
  expect(Pkg::Util::Ship.collect_packages(['pkg/**/*.msi'], ['puppet-agent-x(86|64).msi'])).not_to include('pkg/windows/puppet5/puppet-agent-x86.msi')
25
27
  end
26
28
  it 'correctly includes packages that do not match a passed excluded argument' do
27
- expect(Pkg::Util::Ship.collect_packages(['pkg/**/*.msi'], ['puppet-agent-x(86|64).msi'])).to include('pkg/windows/puppet5/puppet-agent-1.4.1.2904.g8023dd1-x86.msi')
29
+ expect(Pkg::Util::Ship.collect_packages(['pkg/**/*.msi'], ['puppet-agent-x(86|64).msi'])).to \
30
+ match_array(
31
+ [
32
+ 'pkg/windows/puppet5/puppet-agent-1.4.1.2904.g8023dd1-x86.msi',
33
+ 'pkg/windowsfips/puppet5/puppet-agent-1.4.1.2904.g8023dd1-x64.msi',
34
+ ]
35
+ )
28
36
  end
29
37
  end
30
38
 
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.42
4
+ version: 0.99.43
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet Labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-06 00:00:00.000000000 Z
11
+ date: 2019-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -229,28 +229,28 @@ signing_key:
229
229
  specification_version: 4
230
230
  summary: Puppet Labs' packaging automation
231
231
  test_files:
232
+ - spec/lib/packaging/retrieve_spec.rb
232
233
  - spec/lib/packaging/paths_spec.rb
234
+ - spec/lib/packaging/tar_spec.rb
233
235
  - spec/lib/packaging/deb/repo_spec.rb
236
+ - spec/lib/packaging/rpm/repo_spec.rb
237
+ - spec/lib/packaging/artifactory_spec.rb
238
+ - spec/lib/packaging/repo_spec.rb
239
+ - spec/lib/packaging/deb_spec.rb
240
+ - spec/lib/packaging/sign_spec.rb
241
+ - spec/lib/packaging/gem_spec.rb
242
+ - spec/lib/packaging/util/rake_utils_spec.rb
243
+ - spec/lib/packaging/util/git_spec.rb
244
+ - spec/lib/packaging/util/os_spec.rb
234
245
  - spec/lib/packaging/util/misc_spec.rb
246
+ - spec/lib/packaging/util/version_spec.rb
247
+ - spec/lib/packaging/util/file_spec.rb
235
248
  - spec/lib/packaging/util/execution_spec.rb
236
249
  - spec/lib/packaging/util/gpg_spec.rb
237
250
  - spec/lib/packaging/util/jenkins_spec.rb
238
251
  - spec/lib/packaging/util/ship_spec.rb
239
252
  - spec/lib/packaging/util/git_tag_spec.rb
240
- - spec/lib/packaging/util/git_spec.rb
241
- - spec/lib/packaging/util/rake_utils_spec.rb
242
- - spec/lib/packaging/util/file_spec.rb
243
- - spec/lib/packaging/util/os_spec.rb
244
- - spec/lib/packaging/util/version_spec.rb
245
253
  - spec/lib/packaging/util/net_spec.rb
246
- - spec/lib/packaging/deb_spec.rb
247
254
  - spec/lib/packaging/platforms_spec.rb
248
- - spec/lib/packaging/rpm/repo_spec.rb
249
- - spec/lib/packaging/sign_spec.rb
250
- - spec/lib/packaging/retrieve_spec.rb
251
- - spec/lib/packaging/repo_spec.rb
252
- - spec/lib/packaging/artifactory_spec.rb
253
- - spec/lib/packaging/gem_spec.rb
254
- - spec/lib/packaging/tar_spec.rb
255
255
  - spec/lib/packaging/config_spec.rb
256
256
  - spec/lib/packaging_spec.rb