packaging 0.99.49 → 0.99.50

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: 68bf2734bf72e5f9bad6d03c640d28ce516c05b1a5163b20ebf385676e829ae6
4
- data.tar.gz: f54bbad1bd7b25f0e92cd7527de1e03513b557fa4e31db0751f23cd9139d30a6
3
+ metadata.gz: ad409cc1cd10d0f72e9a6e63ba13c32db7b610e3477c691763bb78f949364fd1
4
+ data.tar.gz: d97ee866c371abf36817b33a4cacfcdf9863b76de9d9e46cd8e9f2f4bd39b117
5
5
  SHA512:
6
- metadata.gz: 272b2c612425b4ee0226063c54d7bbbfeb5d5de4162050eb716c3acff4f65282741c528ab9f7290e4a987dae436c268632c7d7556eba9bea77c9feb05f9fc1c2
7
- data.tar.gz: 5995160e79dbf3258fe5e212cd646bee4f9f9bdfc19acdb4780c02f3acea628408f504fbffbca42b7e4ff98600893a37a87d0ecb6e90834c0e4b68f3a73f6109
6
+ metadata.gz: 56f4a038ca5cc5fc4495b9302fc86b1902c5581981d1963097457058f51996163bf76491977037deb2cddea4c0e9248075dab6db329d1c2ff3ba23c4254a7fba
7
+ data.tar.gz: 57c6b4f35809ee6164f243d6f23056f1538347d452124c2d0f714978fa19bd0413c35e723f1fa8f4232546e69db3327d21ee09aed75992866399a3249783d281
@@ -50,12 +50,20 @@ module Pkg::Util::Version
50
50
  end
51
51
  end
52
52
 
53
+ def extended_dash_version
54
+ Pkg::Util::Git.describe(['--tags', '--dirty', '--abbrev=7'])
55
+ end
56
+
53
57
  # This version is used for gems and platform types that do not support
54
58
  # dashes in the package version
55
59
  def dot_version(version = Pkg::Config.version)
56
60
  version.tr('-', '.')
57
61
  end
58
62
 
63
+ def extended_dot_version
64
+ dot_version(extended_dash_version)
65
+ end
66
+
59
67
  # Given a version, reformat it to be appropriate for a final package
60
68
  # version. This means we need to add a `0.` before the release version
61
69
  # for non-final builds
@@ -127,23 +127,33 @@ def create_platform_specific_gems
127
127
  end
128
128
  end
129
129
 
130
+ def package_gem
131
+ unless Pkg::Config.build_gem
132
+ puts "The #{Pkg::Config.project} project does not build any gems! Passing through ..."
133
+ return
134
+ end
135
+
136
+ mkdir_p File.join(Pkg::Config.project_root, "pkg")
137
+ create_default_gem
138
+ if Pkg::Config.gem_platform_dependencies
139
+ create_platform_specific_gems
140
+ end
141
+ end
142
+
130
143
  namespace :package do
131
144
  desc "Build a gem - All gems if platform specific"
132
145
  task :gem => ["clean"] do
133
- unless Pkg::Config.build_gem
134
- puts("The #{Pkg::Config.project} project does not build any gems! Passing through ...")
135
- next
136
- end
146
+ package_gem
147
+ end
137
148
 
138
- mkdir_p File.join(Pkg::Config.project_root, "pkg")
139
- create_default_gem
140
- if Pkg::Config.gem_platform_dependencies
141
- create_platform_specific_gems
142
- end
149
+ task :nightly_gem => ["clean"] do
150
+ Pkg::Config.gemversion = Pkg::Util::Version.extended_dot_version
151
+ package_gem
143
152
  end
144
153
  end
145
154
 
146
155
  # An alias task to simplify our remote logic in jenkins.rake
147
156
  namespace :pl do
148
157
  task :gem => "package:gem"
158
+ task :nightly_gem => "package:nightly_gem"
149
159
  end
@@ -248,6 +248,23 @@ namespace :pl do
248
248
  end
249
249
  end
250
250
  end
251
+
252
+ desc "Remotely link nightly shipped gems to latest versions on #{Pkg::Config.gem_host}"
253
+ task :link_nightly_shipped_gems_to_latest do
254
+ Pkg::Config.gemversion = Pkg::Util::Version.extended_dot_version
255
+
256
+ remote_path = Pkg::Config.nonfinal_gem_path
257
+ gems = FileList['pkg/*.gem'].map! { |path| path.gsub!('pkg/', '') }
258
+ command = %(cd #{remote_path}; )
259
+
260
+ command += gems.map! do |gem_name|
261
+ %(sudo ln -sf #{gem_name} #{gem_name.gsub(Pkg::Config.gemversion, 'latest')})
262
+ end.join(';')
263
+
264
+ command += %(; sync)
265
+
266
+ Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.gem_host, command)
267
+ end
251
268
  end
252
269
 
253
270
  desc "Ship mocked rpms to #{Pkg::Config.yum_staging_server}"
@@ -630,20 +647,27 @@ namespace :pl do
630
647
  # building to. Once we move the Metadata about the output location in
631
648
  # to one source of truth we can refactor this to use that to search
632
649
  # -Sean P. M. 08/12/16
633
- packages = Dir["#{local_dir}/windows/*"]
634
- ['x86', 'x64'].each do |arch|
635
- package_version = Pkg::Util::Git.describe.tr('-', '.')
636
- package_filename = File.join(local_dir, 'windows', "#{Pkg::Config.project}-#{package_version}-#{arch}.msi")
637
- link_filename = File.join(local_dir, 'windows', "#{Pkg::Config.project}-#{arch}.msi")
638
-
639
- next unless !packages.include?(link_filename) && packages.include?(package_filename)
640
- # Dear future code spelunkers:
641
- # Using symlinks instead of hard links causes failures when we try
642
- # to set these files to be immutable. Also be wary of whether the
643
- # linking utility you're using expects the source path to be relative
644
- # to the link target or pwd.
645
- #
646
- FileUtils.ln(package_filename, link_filename)
650
+
651
+ {
652
+ 'windows' => ['x86', 'x64'],
653
+ 'windowsfips' => ['x64']
654
+ }.each_pair do |platform, archs|
655
+ packages = Dir["#{local_dir}/#{platform}/*"]
656
+
657
+ archs.each do |arch|
658
+ package_version = Pkg::Util::Git.describe.tr('-', '.')
659
+ package_filename = File.join(local_dir, platform, "#{Pkg::Config.project}-#{package_version}-#{arch}.msi")
660
+ link_filename = File.join(local_dir, platform, "#{Pkg::Config.project}-#{arch}.msi")
661
+
662
+ next unless !packages.include?(link_filename) && packages.include?(package_filename)
663
+ # Dear future code spelunkers:
664
+ # Using symlinks instead of hard links causes failures when we try
665
+ # to set these files to be immutable. Also be wary of whether the
666
+ # linking utility you're using expects the source path to be relative
667
+ # to the link target or pwd.
668
+ #
669
+ FileUtils.ln(package_filename, link_filename)
670
+ end
647
671
  end
648
672
 
649
673
  Pkg::Util::Execution.retry_on_fail(times: 3) do
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.49
4
+ version: 0.99.50
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-11-20 00:00:00.000000000 Z
11
+ date: 2019-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -244,28 +244,28 @@ signing_key:
244
244
  specification_version: 4
245
245
  summary: Puppet Labs' packaging automation
246
246
  test_files:
247
- - spec/lib/packaging_spec.rb
247
+ - spec/lib/packaging/paths_spec.rb
248
+ - spec/lib/packaging/artifactory_spec.rb
248
249
  - spec/lib/packaging/retrieve_spec.rb
249
- - spec/lib/packaging/tar_spec.rb
250
- - spec/lib/packaging/gem_spec.rb
251
- - spec/lib/packaging/deb/repo_spec.rb
252
- - spec/lib/packaging/deb_spec.rb
253
- - spec/lib/packaging/rpm/repo_spec.rb
254
- - spec/lib/packaging/sign_spec.rb
255
- - spec/lib/packaging/config_spec.rb
256
- - spec/lib/packaging/platforms_spec.rb
257
- - spec/lib/packaging/util/os_spec.rb
258
- - spec/lib/packaging/util/gpg_spec.rb
250
+ - spec/lib/packaging/repo_spec.rb
259
251
  - spec/lib/packaging/util/net_spec.rb
260
- - spec/lib/packaging/util/misc_spec.rb
261
- - spec/lib/packaging/util/git_tag_spec.rb
252
+ - spec/lib/packaging/util/gpg_spec.rb
253
+ - spec/lib/packaging/util/ship_spec.rb
262
254
  - spec/lib/packaging/util/jenkins_spec.rb
263
- - spec/lib/packaging/util/file_spec.rb
255
+ - spec/lib/packaging/util/git_tag_spec.rb
264
256
  - spec/lib/packaging/util/git_spec.rb
265
257
  - spec/lib/packaging/util/version_spec.rb
266
- - spec/lib/packaging/util/execution_spec.rb
267
258
  - spec/lib/packaging/util/rake_utils_spec.rb
268
- - spec/lib/packaging/util/ship_spec.rb
269
- - spec/lib/packaging/repo_spec.rb
270
- - spec/lib/packaging/artifactory_spec.rb
271
- - spec/lib/packaging/paths_spec.rb
259
+ - spec/lib/packaging/util/file_spec.rb
260
+ - spec/lib/packaging/util/misc_spec.rb
261
+ - spec/lib/packaging/util/execution_spec.rb
262
+ - spec/lib/packaging/util/os_spec.rb
263
+ - spec/lib/packaging/config_spec.rb
264
+ - spec/lib/packaging/deb_spec.rb
265
+ - spec/lib/packaging/rpm/repo_spec.rb
266
+ - spec/lib/packaging/tar_spec.rb
267
+ - spec/lib/packaging/sign_spec.rb
268
+ - spec/lib/packaging/platforms_spec.rb
269
+ - spec/lib/packaging/deb/repo_spec.rb
270
+ - spec/lib/packaging/gem_spec.rb
271
+ - spec/lib/packaging_spec.rb