packaging 0.99.78 → 0.99.82

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: 0340bf3301e12ac79afefe26c69ef76c9b826e03804d114fa00be1e94c558214
4
- data.tar.gz: d79eb4d7206d75e38011f783890e8288f4ee12dfefba2c990e511ccbe508e847
3
+ metadata.gz: c6a43cf7156da366bb179c22e647ebc5a1af202cb32902a8f98b21465ddeab23
4
+ data.tar.gz: 53f354754d747f119bd39ee3f072d67ae2f489b8102004904dad592fff0b7db7
5
5
  SHA512:
6
- metadata.gz: 25a54450f869fc920f1308d6446b255ebc9571397df63323d242f0270072a72f68d8febb44feb07c7e12d780656b0d18349f7f389a54bbdf54f970990b2451fb
7
- data.tar.gz: 63ba12e182757008a631ee76551aa43570b97c5ba96787d83dbe1d5b3b5b5808a3a2fb9c2e26e1252febbad15855c4463c1fe531ffbc0dc7604ec9a79a2e52d5
6
+ metadata.gz: 97ef6a07c6e26df4d34ce1619398817fe4d52cdc952d327360a2ce9d4381e7569558f33bb2dba18c455802a875003b78456a3204301bbc736602123fa383a5ec
7
+ data.tar.gz: e7dc544df9a1af85a77477569d7cf2017dab212e94bb179077bf207c539e5f7793a495f8abc95c5cd6ec39721f2a1f7f69e69e4668b01cd9a692cf9e19b8b640
@@ -224,8 +224,6 @@ module Pkg
224
224
  deploy_properties(platform_tag, File.basename(package)),
225
225
  headers
226
226
  )
227
- rescue
228
- raise "Attempt to upload '#{package}' to #{File.join(@artifactory_uri, data[:full_artifactory_path])} failed"
229
227
  end
230
228
 
231
229
  # @param pkg [String] The package to download YAML for
@@ -344,40 +342,69 @@ module Pkg
344
342
  end
345
343
  end
346
344
 
347
- # Using the manifest provided by enterprise-dist, grab the appropropriate packages from artifactory based on md5sum
345
+ # Using the manifest provided by enterprise-dist, grab the
346
+ # appropropriate packages from artifactory based on md5sum
347
+
348
348
  # @param staging_directory [String] location to download packages to
349
- # @param manifest [File] JSON file containing information about what packages to download and the corresponding md5sums
349
+ # @param manifest [File] JSON file listing which packages to download and
350
+ # the corresponding md5sums
350
351
  # @param remote_path [String] Optional partial path on the remote host containing packages
351
352
  # Used to specify which subdirectories packages will be downloaded from.
352
353
  def download_packages(staging_directory, manifest, remote_path = '')
353
354
  check_authorization
355
+ download_repositories = %w(rpm_enterprise__local debian_enterprise__local)
354
356
  manifest.each do |dist, packages|
355
- puts "Grabbing the #{dist} packages from artifactory"
356
357
  packages.each do |name, info|
357
- filename = info['filename']
358
- artifacts = Artifactory::Resource::Artifact.checksum_search(md5: "#{info["md5"]}", repos: ["rpm_enterprise__local", "debian_enterprise__local"], name: filename)
359
- artifact_to_download = artifacts.select { |artifact| artifact.download_uri.include? remote_path }.first
360
- # If we found matching artifacts, but not in the correct path, copy the artifact to the correct path
361
- # This should help us keep repos up to date with the packages we are expecting to be there
362
- # while helping us avoid 'what the hell, could not find package' errors
358
+ package_file_name = info['filename']
359
+ puts format(
360
+ "Searching Artifactory [%s]%s for %s (md5: %s)",
361
+ download_repositories.join(', '),
362
+ remote_path.empty? ? '' : "/#{remote_path}",
363
+ package_file_name,
364
+ info['md5']
365
+ )
366
+ artifacts = Artifactory::Resource::Artifact.checksum_search(
367
+ md5: info['md5'],
368
+ repos: download_repositories,
369
+ name: package_file_name
370
+ )
371
+
372
+ artifact_to_download = artifacts.select do |artifact|
373
+ artifact.download_uri.include? remote_path
374
+ end.first
375
+
376
+ # If we found matching artifacts, but not in the correct
377
+ # path, copy the artifact to the correct path This should
378
+ # help us keep repos up to date with the packages we are
379
+ # expecting to be there while helping us avoid 'could not
380
+ # find package' errors
363
381
  if artifact_to_download.nil? && !artifacts.empty?
364
382
  artifact_to_copy = artifacts.first
365
- copy_artifact(artifact_to_copy, artifact_to_copy.repo, "#{remote_path}/#{dist}/#{filename}")
366
- artifacts = Artifactory::Resource::Artifact.checksum_search(md5: "#{info["md5"]}", repos: ["rpm_enterprise__local", "debian_enterprise__local"], name: filename)
367
- artifact_to_download = artifacts.select { |artifact| artifact.download_uri.include? remote_path }.first
383
+ copy_artifact(artifact_to_copy, artifact_to_copy.repo,
384
+ "#{remote_path}/#{dist}/#{package_file_name}")
385
+
386
+ # Now, search again to make sure we find them in the correct path.
387
+ artifacts = Artifactory::Resource::Artifact.checksum_search(
388
+ md5: info['md5'],
389
+ repos: download_repositories,
390
+ name: package_file_name
391
+ )
392
+ artifact_to_download = artifacts.select do |artifact|
393
+ artifact.download_uri.include? remote_path
394
+ end.first
368
395
  end
369
396
 
370
397
  if artifact_to_download.nil?
371
- message = "Error: what the hell, could not find package #{filename} with md5sum #{info["md5"]}"
372
- unless remote_path.empty?
373
- message += " in #{remote_path}"
374
- end
398
+ message = "Error: could not find package #{package_file_name} " \
399
+ "with md5sum #{info['md5']}"
400
+ message += " in #{remote_path}" unless remote_path.empty?
375
401
  raise message
376
- else
377
- full_staging_path = "#{staging_directory}/#{dist}"
378
- puts "downloading #{artifact_to_download.download_uri} to #{File.join(full_staging_path, filename)}"
379
- artifact_to_download.download(full_staging_path, filename: filename)
380
402
  end
403
+
404
+ full_staging_path = "#{staging_directory}/#{dist}"
405
+ puts "Downloading #{artifact_to_download.download_uri} to " \
406
+ "#{File.join(full_staging_path, package_file_name)}"
407
+ artifact_to_download.download(full_staging_path, filename: package_file_name)
381
408
  end
382
409
  end
383
410
  end
@@ -65,6 +65,7 @@ module Pkg::Params
65
65
  :gem_files,
66
66
  :gem_forge_project,
67
67
  :gem_host,
68
+ :gem_license,
68
69
  :gem_name,
69
70
  :gem_path,
70
71
  :gem_platform_dependencies,
@@ -143,7 +143,7 @@ module Pkg
143
143
  repo: false,
144
144
  },
145
145
  '11' => {
146
- architectures: ['x86_64'],
146
+ architectures: ['x86_64', 'arm64'],
147
147
  package_format: 'dmg',
148
148
  repo: false,
149
149
  },
@@ -157,6 +157,14 @@ module Pkg
157
157
  source_package_formats: ['src.rpm'],
158
158
  signature_format: 'v3',
159
159
  repo: true,
160
+ },
161
+ '8' => {
162
+ architectures: ['x86_64'],
163
+ source_architecture: 'SRPMS',
164
+ package_format: 'rpm',
165
+ source_package_formats: ['src.rpm'],
166
+ signature_format: 'v3',
167
+ repo: true,
160
168
  }
161
169
  },
162
170
 
@@ -219,7 +227,7 @@ module Pkg
219
227
  },
220
228
  '18.04' => {
221
229
  codename: 'bionic',
222
- architectures: ['amd64', 'ppc64el'],
230
+ architectures: ['amd64', 'ppc64el', 'aarch64'],
223
231
  source_architecture: 'source',
224
232
  package_format: 'deb',
225
233
  source_package_formats: DEBIAN_SOURCE_FORMATS,
@@ -12,60 +12,68 @@ module Pkg::Sign::Dmg
12
12
 
13
13
  ssh_host_string = "#{use_identity} #{host_string}"
14
14
  rsync_host_string = "-e 'ssh #{use_identity}' #{host_string}"
15
+ archs = Dir.glob("#{pkg_directory}/{apple,mac,osx}/**/{x86_64,arm64}").map { |el| el.split('/').last }
15
16
 
16
- remote_working_directory = "/tmp/#{Pkg::Util.rand_string}"
17
- dmg_mount_point = File.join(remote_working_directory, "mount")
18
- signed_items_directory = File.join(remote_working_directory, "signed")
19
-
20
- dmgs = Dir.glob("#{pkg_directory}/{apple,mac,osx}/**/*.dmg")
21
- if dmgs.empty?
22
- $stderr.puts "Error: no dmgs found in #{pkg_directory}/{apple,mac,osx}."
17
+ if archs.empty?
18
+ $stderr.puts "Error: no architectures found in #{pkg_directory}/{apple,mac,osx}"
23
19
  exit 1
24
20
  end
25
21
 
26
- dmg_basenames = dmgs.map { |d| File.basename(d, '.dmg') }.join(' ')
27
-
28
- sign_package_command = %W[
29
- for dmg in #{dmg_basenames}; do
30
- /usr/bin/hdiutil attach #{remote_working_directory}/$dmg.dmg
31
- -mountpoint #{dmg_mount_point} -nobrowse -quiet ;
32
-
33
- /usr/bin/security -q unlock-keychain
34
- -p "#{Pkg::Config.osx_signing_keychain_pw}" "#{Pkg::Config.osx_signing_keychain}" ;
35
-
36
- for pkg in #{dmg_mount_point}/*.pkg; do
37
- pkg_basename=$(basename $pkg) ;
38
- if /usr/sbin/pkgutil --check-signature $pkg ; then
39
- echo "Warning: $pkg is already signed, skipping" ;
40
- cp $pkg #{signed_items_directory}/$pkg_basename ;
41
- continue ;
42
- fi ;
43
-
44
- /usr/bin/productsign --keychain "#{Pkg::Config.osx_signing_keychain}"
45
- --sign "#{Pkg::Config.osx_signing_cert}"
46
- $pkg #{signed_items_directory}/$pkg_basename ;
47
- done ;
48
-
49
- /usr/bin/hdiutil detach #{dmg_mount_point} -quiet ;
50
- /bin/rm #{remote_working_directory}/$dmg.dmg ;
51
- /usr/bin/hdiutil create -volname $dmg
52
- -srcfolder #{signed_items_directory}/ #{remote_working_directory}/$dmg.dmg ;
53
- /bin/rm #{signed_items_directory}/* ;
54
- done
55
- ].join(' ')
56
-
57
- Pkg::Util::Net.remote_execute(ssh_host_string,
58
- "mkdir -p #{dmg_mount_point} #{signed_items_directory}")
59
-
60
- Pkg::Util::Net.rsync_to(dmgs.join(' '), rsync_host_string, remote_working_directory)
61
-
62
- Pkg::Util::Net.remote_execute(ssh_host_string, sign_package_command)
63
-
64
- dmgs.each do |dmg|
65
- Pkg::Util::Net.rsync_from(
66
- "#{remote_working_directory}/#{File.basename(dmg)}", rsync_host_string, File.dirname(dmg))
22
+ archs.each do |arch|
23
+ remote_working_directory = "/tmp/#{Pkg::Util.rand_string}/#{arch}"
24
+ dmg_mount_point = File.join(remote_working_directory, "mount")
25
+ signed_items_directory = File.join(remote_working_directory, "signed")
26
+
27
+ dmgs = Dir.glob("#{pkg_directory}/{apple,mac,osx}/**/#{arch}/*.dmg")
28
+ if dmgs.empty?
29
+ $stderr.puts "Error: no dmgs found in #{pkg_directory}/{apple,mac,osx} for #{arch} architecture."
30
+ exit 1
31
+ end
32
+
33
+ dmg_basenames = dmgs.map { |d| File.basename(d, '.dmg') }.join(' ')
34
+
35
+ sign_package_command = %W[
36
+ for dmg in #{dmg_basenames}; do
37
+ /usr/bin/hdiutil attach #{remote_working_directory}/$dmg.dmg
38
+ -mountpoint #{dmg_mount_point} -nobrowse -quiet ;
39
+
40
+ /usr/bin/security -q unlock-keychain
41
+ -p "#{Pkg::Config.osx_signing_keychain_pw}" "#{Pkg::Config.osx_signing_keychain}" ;
42
+
43
+ for pkg in #{dmg_mount_point}/*.pkg; do
44
+ pkg_basename=$(basename $pkg) ;
45
+ if /usr/sbin/pkgutil --check-signature $pkg ; then
46
+ echo "Warning: $pkg is already signed, skipping" ;
47
+ cp $pkg #{signed_items_directory}/$pkg_basename ;
48
+ continue ;
49
+ fi ;
50
+
51
+ /usr/bin/productsign --keychain "#{Pkg::Config.osx_signing_keychain}"
52
+ --sign "#{Pkg::Config.osx_signing_cert}"
53
+ $pkg #{signed_items_directory}/$pkg_basename ;
54
+ done ;
55
+
56
+ /usr/bin/hdiutil detach #{dmg_mount_point} -quiet ;
57
+ /bin/rm #{remote_working_directory}/$dmg.dmg ;
58
+ /usr/bin/hdiutil create -volname $dmg
59
+ -srcfolder #{signed_items_directory}/ #{remote_working_directory}/$dmg.dmg ;
60
+ /bin/rm #{signed_items_directory}/* ;
61
+ done
62
+ ].join(' ')
63
+
64
+ Pkg::Util::Net.remote_execute(ssh_host_string,
65
+ "mkdir -p #{dmg_mount_point} #{signed_items_directory}")
66
+
67
+ Pkg::Util::Net.rsync_to(dmgs.join(' '), rsync_host_string, remote_working_directory)
68
+
69
+ Pkg::Util::Net.remote_execute(ssh_host_string, sign_package_command)
70
+
71
+ dmgs.each do |dmg|
72
+ Pkg::Util::Net.rsync_from(
73
+ "#{remote_working_directory}/#{File.basename(dmg)}", rsync_host_string, File.dirname(dmg))
74
+ end
75
+
76
+ Pkg::Util::Net.remote_execute(ssh_host_string, "rm -rf '#{remote_working_directory}'")
67
77
  end
68
-
69
- Pkg::Util::Net.remote_execute(ssh_host_string, "rm -rf '#{remote_working_directory}'")
70
78
  end
71
79
  end
@@ -52,6 +52,7 @@ describe "Pkg::Config" do
52
52
  :gem_files,
53
53
  :gem_forge_project,
54
54
  :gem_host,
55
+ :gem_license,
55
56
  :gem_name,
56
57
  :gem_path,
57
58
  :gem_platform_dependencies,
data/tasks/gem.rake CHANGED
@@ -39,23 +39,24 @@ end
39
39
 
40
40
  def create_default_gem_spec
41
41
  spec = Gem::Specification.new do |s|
42
- s.name = Pkg::Config.project unless Pkg::Config.project.nil?
43
- s.name = Pkg::Config.gem_name unless Pkg::Config.gem_name.nil?
44
- s.version = Pkg::Config.gemversion unless Pkg::Config.gemversion.nil?
45
- s.author = Pkg::Config.author unless Pkg::Config.author.nil?
46
- s.email = Pkg::Config.email unless Pkg::Config.email.nil?
47
- s.homepage = Pkg::Config.homepage unless Pkg::Config.homepage.nil?
48
- s.summary = Pkg::Config.summary unless Pkg::Config.summary.nil?
49
- s.summary = Pkg::Config.gem_summary unless Pkg::Config.gem_summary.nil?
50
- s.description = Pkg::Config.description unless Pkg::Config.description.nil?
51
- s.description = Pkg::Config.gem_description unless Pkg::Config.gem_description.nil?
52
- s.files = glob_gem_files unless glob_gem_files.nil?
53
- s.executables = Pkg::Config.gem_executables unless Pkg::Config.gem_executables.nil?
54
- s.require_path = Pkg::Config.gem_require_path unless Pkg::Config.gem_require_path.nil?
55
- s.required_ruby_version = Pkg::Config.gem_required_ruby_version unless Pkg::Config.gem_required_ruby_version.nil?
42
+ s.name = Pkg::Config.project unless Pkg::Config.project.nil?
43
+ s.name = Pkg::Config.gem_name unless Pkg::Config.gem_name.nil?
44
+ s.version = Pkg::Config.gemversion unless Pkg::Config.gemversion.nil?
45
+ s.author = Pkg::Config.author unless Pkg::Config.author.nil?
46
+ s.email = Pkg::Config.email unless Pkg::Config.email.nil?
47
+ s.homepage = Pkg::Config.homepage unless Pkg::Config.homepage.nil?
48
+ s.summary = Pkg::Config.summary unless Pkg::Config.summary.nil?
49
+ s.summary = Pkg::Config.gem_summary unless Pkg::Config.gem_summary.nil?
50
+ s.description = Pkg::Config.description unless Pkg::Config.description.nil?
51
+ s.description = Pkg::Config.gem_description unless Pkg::Config.gem_description.nil?
52
+ s.files = glob_gem_files unless glob_gem_files.nil?
53
+ s.executables = Pkg::Config.gem_executables unless Pkg::Config.gem_executables.nil?
54
+ s.require_path = Pkg::Config.gem_require_path unless Pkg::Config.gem_require_path.nil?
55
+ s.required_ruby_version = Pkg::Config.gem_required_ruby_version unless Pkg::Config.gem_required_ruby_version.nil?
56
56
  s.required_rubygems_version = Pkg::Config.gem_required_rubygems_version unless Pkg::Config.gem_required_rubygems_version.nil?
57
- s.test_files = FileList[Pkg::Config.gem_test_files.split(' ')] unless Pkg::Config.gem_test_files.nil?
58
- s.rubyforge_project = Pkg::Config.gem_forge_project unless Pkg::Config.gem_forge_project.nil?
57
+ s.test_files = FileList[Pkg::Config.gem_test_files.split(' ')] unless Pkg::Config.gem_test_files.nil?
58
+ s.license = Pkg::Config.gem_license unless Pkg::Config.gem_license.nil?
59
+ s.rubyforge_project = Pkg::Config.gem_forge_project unless Pkg::Config.gem_forge_project.nil?
59
60
  Pkg::Config.gem_rdoc_options.each do |option|
60
61
  s.rdoc_options << option
61
62
  end unless Pkg::Config.gem_rdoc_options.nil?
@@ -93,7 +93,7 @@ DOC
93
93
  # The repo configs have Pkg::Config.builds_server used in them, but that
94
94
  # is internal, so we need to replace it with our public server. We also
95
95
  # want them only to see repos, and not signed repos, since the host is
96
- # called nightlies.puppetlabs.com. Here we replace those values in each
96
+ # called nightlies.puppet.com. Here we replace those values in each
97
97
  # config with the desired value.
98
98
  Dir.glob("#{local_target}/repo_configs/**/*").select { |t_config| File.file?(t_config) }.each do |config|
99
99
  new_contents = File.read(config).gsub(Pkg::Config.builds_server, target_host).gsub(/#{target_prefix}_repos/, "repos")
data/tasks/ship.rake CHANGED
@@ -172,20 +172,10 @@ namespace :pl do
172
172
  end
173
173
  end
174
174
 
175
- desc "Copy signed deb repos from #{Pkg::Config.apt_signing_server} to AWS S3"
176
- task :deploy_apt_repo_to_s3 => 'pl:fetch' do
177
- puts "Really run S3 sync to deploy Debian repos from #{Pkg::Config.apt_signing_server} to AWS S3? [y,n]"
178
- if Pkg::Util.ask_yes_or_no
179
- Pkg::Util::Execution.retry_on_fail(:times => 3) do
180
- command = 'sudo /usr/local/bin/s3_repo_sync.sh apt.puppetlabs.com'
181
- Pkg::Util::Net.remote_execute(Pkg::Config.apt_signing_server, command)
182
- end
183
- end
184
- end
185
-
186
175
  desc "Copy rpm repos from #{Pkg::Config.yum_staging_server} to #{Pkg::Config.yum_host}"
187
176
  task deploy_yum_repo: 'pl:fetch' do
188
- puts "Really run remote rsync to deploy yum repos from #{Pkg::Config.yum_staging_server} to #{Pkg::Config.yum_host}? [y,n]"
177
+ puts "Really run remote rsync to deploy yum repos from #{Pkg::Config.yum_staging_server} " \
178
+ "to #{Pkg::Config.yum_host}? [y,n]"
189
179
  if Pkg::Util.ask_yes_or_no
190
180
  Pkg::Util::Execution.retry_on_fail(times: 3) do
191
181
  Pkg::Rpm::Repo.deploy_repos(
@@ -198,27 +188,67 @@ namespace :pl do
198
188
  end
199
189
  end
200
190
 
201
- desc "Copy signed RPM repos from #{Pkg::Config.yum_staging_server} to AWS S3"
191
+ ##
192
+ ## S3 / GCP syncing
193
+ S3_REPO_SYNC = 'sudo /usr/local/bin/s3_repo_sync.sh'
194
+ GCP_REPO_SYNC = '/usr/local/bin/gcp_repo_sync'
195
+
196
+ desc "Sync signed apt repos from #{Pkg::Config.apt_signing_server} to AWS S3"
197
+ task :deploy_apt_repo_to_s3 => 'pl:fetch' do
198
+ sync_command = "#{S3_REPO_SYNC} apt.puppetlabs.com"
199
+ puts "Sync apt repos from #{Pkg::Config.apt_signing_server} to AWS S3? [y,n]"
200
+ next unless Pkg::Util.ask_yes_or_no
201
+
202
+ Pkg::Util::Execution.retry_on_fail(times: 3) do
203
+ Pkg::Util::Net.remote_execute(Pkg::Config.apt_signing_server, sync_command)
204
+ end
205
+ end
206
+
207
+ desc "Sync signed yum repos from #{Pkg::Config.yum_staging_server} to AWS S3"
202
208
  task :deploy_yum_repo_to_s3 => 'pl:fetch' do
203
- puts "Really run S3 sync to deploy RPM repos from #{Pkg::Config.yum_staging_server} to AWS S3? [y,n]"
204
- if Pkg::Util.ask_yes_or_no
205
- Pkg::Util::Execution.retry_on_fail(:times => 3) do
206
- command = 'sudo /usr/local/bin/s3_repo_sync.sh yum.puppetlabs.com'
207
- Pkg::Util::Net.remote_execute(Pkg::Config.yum_staging_server, command)
208
- end
209
+ sync_command = "#{S3_REPO_SYNC} yum.puppetlabs.com"
210
+ puts "Sync yum repos from #{Pkg::Config.yum_staging_server} to AWS S3? [y,n]"
211
+ next unless Pkg::Util.ask_yes_or_no
212
+ Pkg::Util::Execution.retry_on_fail(times: 3) do
213
+ Pkg::Util::Net.remote_execute(Pkg::Config.yum_staging_server, sync_command)
209
214
  end
210
215
  end
211
216
 
212
217
  desc "Sync downloads.puppetlabs.com from #{Pkg::Config.staging_server} to AWS S3"
213
218
  task :deploy_downloads_to_s3 => 'pl:fetch' do
214
- puts "Really run S3 sync to sync downloads.puppetlabs.com from #{Pkg::Config.staging_server} to AWS S3? [y,n]"
215
- if Pkg::Util.ask_yes_or_no
216
- Pkg::Util::Execution.retry_on_fail(:times => 3) do
217
- command = 'sudo /usr/local/bin/s3_repo_sync.sh downloads.puppetlabs.com'
218
- Pkg::Util::Net.remote_execute(Pkg::Config.staging_server, command)
219
- end
219
+ sync_command = "#{S3_REPO_SYNC} downloads.puppetlabs.com"
220
+ puts "Sync downloads.puppetlabs.com from #{Pkg::Config.staging_server} to AWS S3? [y,n]"
221
+ next unless Pkg::Util.ask_yes_or_no
222
+ Pkg::Util::Execution.retry_on_fail(times: 3) do
223
+ Pkg::Util::Net.remote_execute(Pkg::Config.staging_server, sync_command)
224
+ end
225
+ end
226
+
227
+ desc "Sync nightlies.puppet.com from #{Pkg::Config.staging_server} to AWS S3"
228
+ task :deploy_nightlies_to_s3 => 'pl:fetch' do
229
+ sync_command = "#{S3_REPO_SYNC} nightlies.puppet.com"
230
+ puts "Syncing nightly builds from #{Pkg::Config.staging_server} to AWS S3"
231
+ Pkg::Util::Execution.retry_on_fail(times: 3) do
232
+ Pkg::Util::Net.remote_execute(Pkg::Config.staging_server, sync_command)
233
+ end
234
+ end
235
+
236
+ desc "Sync signed apt repos from #{Pkg::Config.apt_signing_server} to Google Cloud Platform"
237
+ task :sync_apt_repo_to_gcp => 'pl:fetch' do
238
+ target_site = 'apt.repos.puppetlabs.com'
239
+ sync_command_puppet_6 = "#{GCP_REPO_SYNC} apt.repos.puppet.com puppet6"
240
+ sync_command_puppet_7 = "#{GCP_REPO_SYNC} apt.repos.puppet.com puppet7"
241
+ print "Sync apt repos from #{Pkg::Config.apt_signing_server} to #{target_site}? [y,n] "
242
+ next unless Pkg::Util.ask_yes_or_no
243
+ puts
244
+
245
+ Pkg::Util::Execution.retry_on_fail(times: 3) do
246
+ Pkg::Util::Net.remote_execute(Pkg::Config.apt_signing_server, sync_command_puppet_6)
247
+ Pkg::Util::Net.remote_execute(Pkg::Config.apt_signing_server, sync_command_puppet_7)
220
248
  end
221
249
  end
250
+ # Keep 'deploy' for backward compatibility
251
+ task :deploy_apt_repo_to_gcp => :sync_apt_repo_to_gcp
222
252
 
223
253
  desc "Sync apt, yum, and downloads.pl.com to AWS S3"
224
254
  task :deploy_final_builds_to_s3 => "pl:fetch" do
@@ -227,15 +257,6 @@ namespace :pl do
227
257
  Rake::Task['pl:remote:deploy_downloads_to_s3'].invoke
228
258
  end
229
259
 
230
- desc "Sync nightlies.puppetlabs.com from #{Pkg::Config.staging_server} to AWS S3"
231
- task :deploy_nightlies_to_s3 => 'pl:fetch' do
232
- puts "Deploying nightly builds from #{Pkg::Config.staging_server} to AWS S3..."
233
- Pkg::Util::Execution.retry_on_fail(:times => 3) do
234
- command = 'sudo /usr/local/bin/s3_repo_sync.sh nightlies.puppet.com'
235
- Pkg::Util::Net.remote_execute(Pkg::Config.staging_server, command)
236
- end
237
- end
238
-
239
260
  desc "Sync yum and apt from #{Pkg::Config.staging_server} to rsync servers"
240
261
  task :deploy_to_rsync_server => 'pl:fetch' do
241
262
  # This task must run after the S3 sync has run, or else /opt/repo-s3-stage won't be up-to-date
@@ -553,7 +574,17 @@ namespace :pl do
553
574
  artifactory = Pkg::ManageArtifactory.new(Pkg::Config.project, Pkg::Config.ref)
554
575
 
555
576
  local_dir = args.local_dir || 'pkg'
556
- Dir.glob("#{local_dir}/**/*").reject { |e| File.directory? e }.each do |artifact|
577
+ artifacts = Dir.glob("#{local_dir}/**/*").reject { |e| File.directory? e }
578
+ artifacts.sort! do |a, b|
579
+ if File.extname(a) =~ /(md5|sha\d+)/ && File.extname(b) !~ /(md5|sha\d+)/
580
+ 1
581
+ elsif File.extname(b) =~ /(md5|sha\d+)/ && File.extname(a) !~ /(md5|sha\d+)/
582
+ -1
583
+ else
584
+ a <=> b
585
+ end
586
+ end
587
+ artifacts.each do |artifact|
557
588
  if File.extname(artifact) == ".yaml" || File.extname(artifact) == ".json"
558
589
  artifactory.deploy_package(artifact)
559
590
  elsif artifactory.package_exists_on_artifactory?(artifact)
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.78
4
+ version: 0.99.82
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet Labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-21 00:00:00.000000000 Z
11
+ date: 2021-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -260,28 +260,28 @@ signing_key:
260
260
  specification_version: 4
261
261
  summary: Puppet Labs' packaging automation
262
262
  test_files:
263
+ - spec/lib/packaging/config_spec.rb
263
264
  - spec/lib/packaging/sign_spec.rb
264
- - spec/lib/packaging/rpm/repo_spec.rb
265
- - spec/lib/packaging/retrieve_spec.rb
266
- - spec/lib/packaging/deb/repo_spec.rb
267
- - spec/lib/packaging/tar_spec.rb
268
- - spec/lib/packaging/util/jenkins_spec.rb
269
- - spec/lib/packaging/util/gpg_spec.rb
265
+ - spec/lib/packaging/platforms_spec.rb
270
266
  - spec/lib/packaging/util/rake_utils_spec.rb
271
- - spec/lib/packaging/util/misc_spec.rb
267
+ - spec/lib/packaging/util/jenkins_spec.rb
268
+ - spec/lib/packaging/util/execution_spec.rb
269
+ - spec/lib/packaging/util/net_spec.rb
272
270
  - spec/lib/packaging/util/file_spec.rb
271
+ - spec/lib/packaging/util/misc_spec.rb
272
+ - spec/lib/packaging/util/gpg_spec.rb
273
273
  - spec/lib/packaging/util/version_spec.rb
274
274
  - spec/lib/packaging/util/os_spec.rb
275
275
  - spec/lib/packaging/util/git_spec.rb
276
- - spec/lib/packaging/util/net_spec.rb
277
- - spec/lib/packaging/util/ship_spec.rb
278
- - spec/lib/packaging/util/execution_spec.rb
279
276
  - spec/lib/packaging/util/git_tag_spec.rb
280
- - spec/lib/packaging/gem_spec.rb
281
- - spec/lib/packaging/deb_spec.rb
277
+ - spec/lib/packaging/util/ship_spec.rb
278
+ - spec/lib/packaging/tar_spec.rb
282
279
  - spec/lib/packaging/repo_spec.rb
283
- - spec/lib/packaging/platforms_spec.rb
284
- - spec/lib/packaging/artifactory_spec.rb
285
- - spec/lib/packaging/config_spec.rb
280
+ - spec/lib/packaging/deb_spec.rb
286
281
  - spec/lib/packaging/paths_spec.rb
282
+ - spec/lib/packaging/rpm/repo_spec.rb
283
+ - spec/lib/packaging/gem_spec.rb
284
+ - spec/lib/packaging/retrieve_spec.rb
285
+ - spec/lib/packaging/artifactory_spec.rb
286
+ - spec/lib/packaging/deb/repo_spec.rb
287
287
  - spec/lib/packaging_spec.rb