packaging 0.99.77 → 0.99.81
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/packaging/artifactory.rb +49 -22
- data/lib/packaging/config/params.rb +1 -0
- data/lib/packaging/platforms.rb +18 -2
- data/lib/packaging/sign/dmg.rb +68 -30
- data/spec/lib/packaging/config_spec.rb +1 -0
- data/spec/lib/packaging/platforms_spec.rb +1 -1
- data/tasks/gem.rake +17 -16
- data/tasks/nightly_repos.rake +1 -1
- data/tasks/ship.rake +66 -35
- metadata +17 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b6b5822d617cc1452e3bb9cdf7fc9c5788fc71cfe3e05557bf5a0efb0e7db07
|
4
|
+
data.tar.gz: 19266ebee48e9231a450a0a511e26583aeb161c8d0bf7d45fd1e4cdedd6a1673
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84a29597af4cd4c654f127eac2179be39721af304bf71d3c7e6f0d8a216930ab9bcb782c2575d92fd20a259572ff63684efe869bb2b08019ed80e1bbf1f65585
|
7
|
+
data.tar.gz: d7e30e71d5f197c958dc688d9904c7a431dee71ad3669dd6d3b8792e80f5cda5153fea85272b0be19e6701b645862e0be14d2ad452e7bad46235d5764e38d874
|
@@ -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
|
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
|
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
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
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,
|
366
|
-
|
367
|
-
|
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:
|
372
|
-
|
373
|
-
|
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
|
data/lib/packaging/platforms.rb
CHANGED
@@ -46,6 +46,14 @@ module Pkg
|
|
46
46
|
source_package_formats: DEBIAN_SOURCE_FORMATS,
|
47
47
|
repo: true,
|
48
48
|
},
|
49
|
+
'11' => {
|
50
|
+
codename: 'bullseye',
|
51
|
+
architectures: ['amd64'],
|
52
|
+
source_architecture: 'source',
|
53
|
+
package_format: 'deb',
|
54
|
+
source_package_formats: DEBIAN_SOURCE_FORMATS,
|
55
|
+
repo: true,
|
56
|
+
},
|
49
57
|
},
|
50
58
|
|
51
59
|
'el' => {
|
@@ -135,7 +143,7 @@ module Pkg
|
|
135
143
|
repo: false,
|
136
144
|
},
|
137
145
|
'11' => {
|
138
|
-
architectures: ['x86_64'],
|
146
|
+
architectures: ['x86_64', 'arm64'],
|
139
147
|
package_format: 'dmg',
|
140
148
|
repo: false,
|
141
149
|
},
|
@@ -149,6 +157,14 @@ module Pkg
|
|
149
157
|
source_package_formats: ['src.rpm'],
|
150
158
|
signature_format: 'v3',
|
151
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,
|
152
168
|
}
|
153
169
|
},
|
154
170
|
|
@@ -211,7 +227,7 @@ module Pkg
|
|
211
227
|
},
|
212
228
|
'18.04' => {
|
213
229
|
codename: 'bionic',
|
214
|
-
architectures: ['amd64', 'ppc64el'],
|
230
|
+
architectures: ['amd64', 'ppc64el', 'aarch64'],
|
215
231
|
source_architecture: 'source',
|
216
232
|
package_format: 'deb',
|
217
233
|
source_package_formats: DEBIAN_SOURCE_FORMATS,
|
data/lib/packaging/sign/dmg.rb
CHANGED
@@ -1,41 +1,79 @@
|
|
1
1
|
module Pkg::Sign::Dmg
|
2
2
|
module_function
|
3
3
|
|
4
|
-
def sign(
|
5
|
-
use_identity =
|
6
|
-
|
7
|
-
|
8
|
-
host_string = "#{Pkg::Config.osx_signing_server}"
|
9
|
-
else
|
10
|
-
host_string = "#{ENV['USER']}@#{Pkg::Config.osx_signing_server}"
|
4
|
+
def sign(pkg_directory = 'pkg')
|
5
|
+
use_identity = ''
|
6
|
+
unless Pkg::Config.osx_signing_ssh_key.nil?
|
7
|
+
use_identity = "-i #{Pkg::Config.osx_signing_ssh_key}"
|
11
8
|
end
|
9
|
+
|
10
|
+
host_string = "#{ENV['USER']}@#{Pkg::Config.osx_signing_server}"
|
11
|
+
host_string = "#{Pkg::Config.osx_signing_server}" if Pkg::Config.osx_signing_server =~ /@/
|
12
|
+
|
12
13
|
ssh_host_string = "#{use_identity} #{host_string}"
|
13
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 }
|
16
|
+
|
17
|
+
if archs.empty?
|
18
|
+
$stderr.puts "Error: no architectures found in #{pkg_directory}/{apple,mac,osx}"
|
19
|
+
exit 1
|
20
|
+
end
|
21
|
+
|
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 ;
|
14
39
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
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}/* ;
|
31
61
|
done
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
Pkg::Util::Net.
|
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}'")
|
38
77
|
end
|
39
|
-
Pkg::Util::Net.remote_execute(ssh_host_string, "if [ -d '#{work_dir}' ]; then rm -rf '#{work_dir}'; fi")
|
40
78
|
end
|
41
79
|
end
|
@@ -36,7 +36,7 @@ describe 'Pkg::Platforms' do
|
|
36
36
|
|
37
37
|
describe '#codenames' do
|
38
38
|
it 'should return all codenames for a given platform' do
|
39
|
-
codenames = ['focal', 'bionic', 'buster', 'cosmic', 'jessie', 'stretch', 'trusty', 'xenial']
|
39
|
+
codenames = ['focal', 'bionic', 'bullseye', 'buster', 'cosmic', 'jessie', 'stretch', 'trusty', 'xenial']
|
40
40
|
expect(Pkg::Platforms.codenames).to match_array(codenames)
|
41
41
|
end
|
42
42
|
end
|
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
|
43
|
-
s.name = Pkg::Config.gem_name
|
44
|
-
s.version = Pkg::Config.gemversion
|
45
|
-
s.author = Pkg::Config.author
|
46
|
-
s.email = Pkg::Config.email
|
47
|
-
s.homepage = Pkg::Config.homepage
|
48
|
-
s.summary = Pkg::Config.summary
|
49
|
-
s.summary = Pkg::Config.gem_summary
|
50
|
-
s.description = Pkg::Config.description
|
51
|
-
s.description = Pkg::Config.gem_description
|
52
|
-
s.files = glob_gem_files
|
53
|
-
s.executables = Pkg::Config.gem_executables
|
54
|
-
s.require_path = Pkg::Config.gem_require_path
|
55
|
-
s.required_ruby_version = Pkg::Config.gem_required_ruby_version
|
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(' ')]
|
58
|
-
s.
|
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?
|
data/tasks/nightly_repos.rake
CHANGED
@@ -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.
|
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}
|
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
|
-
|
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
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
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
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
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 }
|
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.
|
4
|
+
version: 0.99.81
|
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-
|
11
|
+
date: 2021-09-17 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/
|
263
|
+
- spec/lib/packaging/config_spec.rb
|
264
264
|
- spec/lib/packaging/sign_spec.rb
|
265
|
-
- spec/lib/packaging/paths_spec.rb
|
266
|
-
- spec/lib/packaging/artifactory_spec.rb
|
267
|
-
- spec/lib/packaging/tar_spec.rb
|
268
|
-
- spec/lib/packaging/deb_spec.rb
|
269
|
-
- spec/lib/packaging/retrieve_spec.rb
|
270
|
-
- spec/lib/packaging/deb/repo_spec.rb
|
271
265
|
- spec/lib/packaging/platforms_spec.rb
|
272
|
-
- spec/lib/packaging/util/execution_spec.rb
|
273
|
-
- spec/lib/packaging/util/jenkins_spec.rb
|
274
|
-
- spec/lib/packaging/util/gpg_spec.rb
|
275
|
-
- spec/lib/packaging/util/git_tag_spec.rb
|
276
|
-
- spec/lib/packaging/util/misc_spec.rb
|
277
|
-
- spec/lib/packaging/util/os_spec.rb
|
278
266
|
- spec/lib/packaging/util/rake_utils_spec.rb
|
267
|
+
- spec/lib/packaging/util/jenkins_spec.rb
|
268
|
+
- spec/lib/packaging/util/execution_spec.rb
|
279
269
|
- spec/lib/packaging/util/net_spec.rb
|
280
270
|
- spec/lib/packaging/util/file_spec.rb
|
271
|
+
- spec/lib/packaging/util/misc_spec.rb
|
272
|
+
- spec/lib/packaging/util/gpg_spec.rb
|
281
273
|
- spec/lib/packaging/util/version_spec.rb
|
274
|
+
- spec/lib/packaging/util/os_spec.rb
|
282
275
|
- spec/lib/packaging/util/git_spec.rb
|
276
|
+
- spec/lib/packaging/util/git_tag_spec.rb
|
283
277
|
- spec/lib/packaging/util/ship_spec.rb
|
284
|
-
- spec/lib/packaging/
|
285
|
-
- spec/lib/packaging/rpm/repo_spec.rb
|
278
|
+
- spec/lib/packaging/tar_spec.rb
|
286
279
|
- spec/lib/packaging/repo_spec.rb
|
280
|
+
- spec/lib/packaging/deb_spec.rb
|
281
|
+
- spec/lib/packaging/paths_spec.rb
|
282
|
+
- spec/lib/packaging/rpm/repo_spec.rb
|
287
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
|
+
- spec/lib/packaging_spec.rb
|