packaging 0.99.41 → 0.99.42
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 +5 -5
- data/lib/packaging/artifactory.rb +28 -0
- data/lib/packaging/repo.rb +94 -21
- data/spec/lib/packaging/repo_spec.rb +42 -40
- data/tasks/nightly_repos.rake +0 -54
- metadata +18 -19
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: fd24a8988e84d0bda7452b64162e7d6e884b92bd6d5f4ceccc83483f62383da2
|
|
4
|
+
data.tar.gz: fa19cd31ea261e6e3ff17762f17e869f6098c1a07714faafa582381225953c7f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8346344afaedd5e10b1d3eab98b0e3bc6a4b894ca90990f7f1dd6a595c373c8f7bd383d545a2441cacb5bb69dc03a9920818352e740c1085381fcebd6693b9ad
|
|
7
|
+
data.tar.gz: d0b4ae82cf80a0658df1165f2eeb7375b697a335618ff1cc312394d617e1422f47a5e7abf41edd60d0cdb66e2ccda33447c30a710de94c7bce332c6d5743d32a
|
|
@@ -376,6 +376,34 @@ module Pkg
|
|
|
376
376
|
end
|
|
377
377
|
end
|
|
378
378
|
|
|
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)
|
|
384
|
+
check_authorization
|
|
385
|
+
artifact = Artifactory::Resource::Artifact.new(local_path: latest_file)
|
|
386
|
+
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?"
|
|
390
|
+
end
|
|
391
|
+
end
|
|
392
|
+
|
|
393
|
+
# Download an artifact based on name, repo, and path to artifact
|
|
394
|
+
# @param artifact_name [String] name of artifact to download
|
|
395
|
+
# @param repo [String] repo the artifact lives
|
|
396
|
+
# @param path [String] path to artifact in the repo
|
|
397
|
+
def download_artifact(artifact_name, repo, path)
|
|
398
|
+
check_authorization
|
|
399
|
+
artifacts = Artifactory::Resource::Artifact.search(name: artifact_name, repos: repo)
|
|
400
|
+
artifacts.each do |artifact|
|
|
401
|
+
if artifact.download_uri.include? path
|
|
402
|
+
artifact.download('.')
|
|
403
|
+
end
|
|
404
|
+
end
|
|
405
|
+
end
|
|
406
|
+
|
|
379
407
|
# Remove shipped PE tarballs from artifactory
|
|
380
408
|
# Used when compose fails, we only want the tarball shipped to artifactory if all platforms succeed
|
|
381
409
|
# Identify which packages were created and shipped based on md5sum and remove them
|
data/lib/packaging/repo.rb
CHANGED
|
@@ -1,35 +1,108 @@
|
|
|
1
1
|
module Pkg::Repo
|
|
2
2
|
|
|
3
3
|
class << self
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
##
|
|
6
|
+
## Construct a local_target based upon the versioning style
|
|
7
|
+
##
|
|
8
|
+
def construct_local_target_path(project, versioning)
|
|
9
|
+
case versioning
|
|
10
|
+
when 'ref'
|
|
11
|
+
return File.join(project, Pkg::Config.ref)
|
|
12
|
+
when 'version'
|
|
13
|
+
return File.join(project, Pkg::Util::Version.dot_version)
|
|
14
|
+
else
|
|
15
|
+
fail "Error: Unknown versioning argument: #{versioning}"
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
##
|
|
20
|
+
## Put a single signed repo into a tarball stored in
|
|
21
|
+
## 'pkg/<local_target>/<archive_name>.tar.gz'
|
|
22
|
+
##
|
|
23
|
+
def create_signed_repo_archive(repo_location, archive_name, versioning)
|
|
5
24
|
tar = Pkg::Util::Tool.check_tool('tar')
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
25
|
+
|
|
26
|
+
local_target = construct_local_target_path(Pkg::Config.project, versioning)
|
|
27
|
+
|
|
28
|
+
if Pkg::Util::File.empty_dir?(File.join('pkg', local_target, repo_location))
|
|
29
|
+
if ENV['FAIL_ON_MISSING_TARGET'] == "true"
|
|
30
|
+
raise "Error: missing packages under #{repo_location}"
|
|
11
31
|
end
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
32
|
+
warn "Warn: Skipping #{archive_name} because #{repo_location} has no files"
|
|
33
|
+
return
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
Dir.chdir(File.join('pkg', local_target)) do
|
|
37
|
+
puts "Info: Archiving #{repo_location} as #{archive_name}"
|
|
38
|
+
target_tarball = File.join('repos', "#{archive_name}.tar.gz")
|
|
39
|
+
tar_command = "#{tar} --owner=0 --group=0 --create --gzip --file #{target_tarball} #{repo_location}"
|
|
40
|
+
stdout, _, _ = Pkg::Util::Execution.capture3(tar_command)
|
|
41
|
+
return stdout
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
##
|
|
46
|
+
## Add a single repo tarball into the 'all' tarball located in
|
|
47
|
+
## 'pkg/<local_target>/<project>-all.tar'
|
|
48
|
+
## Create the 'all' tarball if needed.
|
|
49
|
+
##
|
|
50
|
+
def update_tarball_of_all_repos(project, platform, versioning)
|
|
51
|
+
tar = Pkg::Util::Tool.check_tool('tar')
|
|
52
|
+
|
|
53
|
+
all_repos_tarball_name = "#{project}-all.tar"
|
|
54
|
+
archive_name = "#{project}-#{platform['name']}"
|
|
55
|
+
local_target = construct_local_target_path(project, versioning)
|
|
56
|
+
repo_tarball_name = "#{archive_name}.tar.gz"
|
|
57
|
+
repo_tarball_path = File.join('repos', repo_tarball_name)
|
|
58
|
+
|
|
59
|
+
Dir.chdir(File.join('pkg', local_target)) do
|
|
60
|
+
unless Pkg::Util::File.exist?(repo_tarball_path)
|
|
61
|
+
warn "Skipping #{archive_name} because it (#{repo_tarball_path}) contains no files"
|
|
62
|
+
next
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
tar_action = "--create"
|
|
66
|
+
if File.exist?(all_repos_tarball_name)
|
|
67
|
+
tar_action = "--update"
|
|
24
68
|
end
|
|
69
|
+
|
|
70
|
+
tar_command = "#{tar} --owner=0 --group=0 #{tar_action} --file #{all_repos_tarball_name} #{repo_tarball_path}"
|
|
71
|
+
stdout, _, _ = Pkg::Util::Execution.capture3(tar_command)
|
|
72
|
+
puts stdout
|
|
25
73
|
end
|
|
26
74
|
end
|
|
27
75
|
|
|
76
|
+
##
|
|
77
|
+
## Invoke gzip to compress the 'all' tarball located in
|
|
78
|
+
## 'pkg/<local_target>/<project>-all.tar'
|
|
79
|
+
##
|
|
80
|
+
def compress_tarball_of_all_repos(all_repos_tarball_name)
|
|
81
|
+
gzip = Pkg::Util::Tool.check_tool('gzip')
|
|
82
|
+
|
|
83
|
+
gzip_command = "#{gzip} --fast #{all_repos_tarball_name}"
|
|
84
|
+
stdout, _, _ = Pkg::Util::Execution.capture3(gzip_command)
|
|
85
|
+
puts stdout
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
##
|
|
89
|
+
## Generate each of the repos listed in <Config.platform_repos>.
|
|
90
|
+
## Update the 'all repos' tarball as we do each one.
|
|
91
|
+
## Compress the 'all repos' tarball when all the repos have been generated
|
|
92
|
+
##
|
|
28
93
|
def create_all_repo_archives(project, versioning)
|
|
29
94
|
platforms = Pkg::Config.platform_repos
|
|
95
|
+
local_target = construct_local_target_path(project, versioning)
|
|
96
|
+
all_repos_tarball_name = "#{project}-all.tar"
|
|
97
|
+
|
|
30
98
|
platforms.each do |platform|
|
|
31
99
|
archive_name = "#{project}-#{platform['name']}"
|
|
32
100
|
create_signed_repo_archive(platform['repo_location'], archive_name, versioning)
|
|
101
|
+
update_tarball_of_all_repos(project, platform, versioning)
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
Dir.chdir(File.join('pkg', local_target)) do
|
|
105
|
+
compress_tarball_of_all_repos(all_repos_tarball_name)
|
|
33
106
|
end
|
|
34
107
|
end
|
|
35
108
|
|
|
@@ -40,7 +113,7 @@ module Pkg::Repo
|
|
|
40
113
|
stdout, stderr = Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.distribution_server, cmd, true)
|
|
41
114
|
return stdout.split
|
|
42
115
|
rescue => e
|
|
43
|
-
fail "Could not retrieve directories that contain #{pkg_ext} packages in #{Pkg::Config.distribution_server}:#{artifact_directory}"
|
|
116
|
+
fail "Error: Could not retrieve directories that contain #{pkg_ext} packages in #{Pkg::Config.distribution_server}:#{artifact_directory}"
|
|
44
117
|
end
|
|
45
118
|
|
|
46
119
|
def populate_repo_directory(artifact_parent_directory)
|
|
@@ -49,7 +122,7 @@ module Pkg::Repo
|
|
|
49
122
|
cmd << 'rsync --archive --verbose --one-file-system --ignore-existing artifacts/ repos/ '
|
|
50
123
|
Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.distribution_server, cmd)
|
|
51
124
|
rescue => e
|
|
52
|
-
fail "Could not populate repos directory in #{Pkg::Config.distribution_server}:#{artifact_parent_directory}"
|
|
125
|
+
fail "Error: Could not populate repos directory in #{Pkg::Config.distribution_server}:#{artifact_parent_directory}"
|
|
53
126
|
end
|
|
54
127
|
|
|
55
128
|
def argument_required?(argument_name, repo_command)
|
|
@@ -57,7 +130,7 @@ module Pkg::Repo
|
|
|
57
130
|
end
|
|
58
131
|
|
|
59
132
|
def update_repo(remote_host, command, options = {})
|
|
60
|
-
fail_message = "Missing required argument '%s', update your build_defaults?"
|
|
133
|
+
fail_message = "Error: Missing required argument '%s', update your build_defaults?"
|
|
61
134
|
[:repo_name, :repo_path, :repo_host, :repo_url].each do |option|
|
|
62
135
|
fail fail_message % option.to_s if argument_required?(option.to_s, command) && !options[option]
|
|
63
136
|
end
|
|
@@ -16,46 +16,45 @@ describe "#Pkg::Repo" do
|
|
|
16
16
|
allow(Pkg::Util::File).to receive(:empty_dir?).and_return(false)
|
|
17
17
|
allow(Pkg::Util::Execution).to receive(:capture3)
|
|
18
18
|
|
|
19
|
-
expect(Dir).to receive(:chdir).with(
|
|
20
|
-
expect(Dir).to receive(:chdir).with("project/1.1.1").and_yield
|
|
19
|
+
expect(Dir).to receive(:chdir).with('pkg/project/1.1.1').and_yield
|
|
21
20
|
Pkg::Repo.create_signed_repo_archive("/path", "project-debian-6-i386", "version")
|
|
22
21
|
end
|
|
23
22
|
|
|
24
|
-
it
|
|
25
|
-
allow(Pkg::Util::Tool).to receive(:check_tool).and_return(
|
|
26
|
-
allow(Dir).to receive(:chdir).with(
|
|
23
|
+
it 'should use a ref if ref is specified as versioning' do
|
|
24
|
+
allow(Pkg::Util::Tool).to receive(:check_tool).and_return('tarcommand')
|
|
25
|
+
allow(Dir).to receive(:chdir).with('pkg').and_yield
|
|
27
26
|
allow(Pkg::Util::File).to receive(:empty_dir?).and_return(false)
|
|
28
27
|
allow(Pkg::Util::Execution).to receive(:capture3)
|
|
29
28
|
|
|
30
|
-
expect(Pkg::Config).to receive(:project).and_return(
|
|
31
|
-
expect(Pkg::Config).to receive(:ref).and_return(
|
|
32
|
-
expect(Dir).to receive(:chdir).with(
|
|
33
|
-
Pkg::Repo.create_signed_repo_archive(
|
|
29
|
+
expect(Pkg::Config).to receive(:project).and_return('project')
|
|
30
|
+
expect(Pkg::Config).to receive(:ref).and_return('AAAAAAAAAAAAAAA')
|
|
31
|
+
expect(Dir).to receive(:chdir).with('pkg/project/AAAAAAAAAAAAAAA').and_yield
|
|
32
|
+
Pkg::Repo.create_signed_repo_archive('/path', 'project-debian-6-i386', 'ref')
|
|
34
33
|
end
|
|
35
34
|
|
|
36
|
-
it
|
|
37
|
-
allow(Pkg::Util::Tool).to receive(:check_tool).and_return(
|
|
38
|
-
allow(Dir).to receive(:chdir).with(
|
|
35
|
+
it 'should use dot versions if version is specified as versioning' do
|
|
36
|
+
allow(Pkg::Util::Tool).to receive(:check_tool).and_return('tarcommand')
|
|
37
|
+
allow(Dir).to receive(:chdir).with('pkg').and_yield
|
|
39
38
|
allow(Pkg::Util::File).to receive(:empty_dir?).and_return(false)
|
|
40
39
|
allow(Pkg::Util::Execution).to receive(:capture3)
|
|
41
40
|
|
|
42
|
-
expect(Pkg::Config).to receive(:project).and_return(
|
|
43
|
-
expect(Pkg::Util::Version).to receive(:dot_version).and_return(
|
|
44
|
-
expect(Dir).to receive(:chdir).with(
|
|
45
|
-
Pkg::Repo.create_signed_repo_archive(
|
|
41
|
+
expect(Pkg::Config).to receive(:project).and_return('project')
|
|
42
|
+
expect(Pkg::Util::Version).to receive(:dot_version).and_return('1.1.1')
|
|
43
|
+
expect(Dir).to receive(:chdir).with('pkg/project/1.1.1').and_yield
|
|
44
|
+
Pkg::Repo.create_signed_repo_archive('/path', 'project-debian-6-i386', 'version')
|
|
46
45
|
end
|
|
47
46
|
|
|
48
|
-
it
|
|
49
|
-
allow(Pkg::Util::Tool).to receive(:check_tool).and_return(
|
|
50
|
-
allow(Pkg::Config).to receive(:project).and_return(
|
|
51
|
-
allow(Pkg::Util::Version).to receive(:dot_version).and_return(
|
|
47
|
+
it 'should fail if ENV["FAIL_ON_MISSING_TARGET"] is true and empty_dir? is also true' do
|
|
48
|
+
allow(Pkg::Util::Tool).to receive(:check_tool).and_return('tarcommand')
|
|
49
|
+
allow(Pkg::Config).to receive(:project).and_return('project')
|
|
50
|
+
allow(Pkg::Util::Version).to receive(:dot_version).and_return('1.1.1')
|
|
52
51
|
allow(Pkg::Util::Execution).to receive(:capture3)
|
|
53
|
-
allow(Dir).to receive(:chdir).with(
|
|
54
|
-
allow(Dir).to receive(:chdir).with(
|
|
52
|
+
allow(Dir).to receive(:chdir).with('pkg').and_yield
|
|
53
|
+
allow(Dir).to receive(:chdir).with('project/1.1.1').and_yield
|
|
55
54
|
allow(Pkg::Util::File).to receive(:empty_dir?).and_return(true)
|
|
56
|
-
ENV['FAIL_ON_MISSING_TARGET'] =
|
|
55
|
+
ENV['FAIL_ON_MISSING_TARGET'] = 'true'
|
|
57
56
|
|
|
58
|
-
expect{Pkg::Repo.create_signed_repo_archive(
|
|
57
|
+
expect{Pkg::Repo.create_signed_repo_archive('/path', 'project-debian-6-i386', 'version')}.to raise_error(RuntimeError, 'Error: missing packages under /path')
|
|
59
58
|
end
|
|
60
59
|
|
|
61
60
|
it "should only warn if ENV['FAIL_ON_MISSING_TARGET'] is false and empty_dir? is true" do
|
|
@@ -63,35 +62,38 @@ describe "#Pkg::Repo" do
|
|
|
63
62
|
allow(Pkg::Config).to receive(:project).and_return("project")
|
|
64
63
|
allow(Pkg::Util::Version).to receive(:dot_version).and_return("1.1.1")
|
|
65
64
|
allow(Pkg::Util::Execution).to receive(:capture3)
|
|
66
|
-
allow(Dir).to receive(:chdir).with("pkg").and_yield
|
|
67
|
-
allow(Dir).to receive(:chdir).with("project/1.1.1").and_yield
|
|
65
|
+
allow(Dir).to receive(:chdir).with("pkg/project/1.1.1").and_yield
|
|
68
66
|
allow(Pkg::Util::File).to receive(:empty_dir?).and_return(true)
|
|
69
67
|
ENV['FAIL_ON_MISSING_TARGET'] = "false"
|
|
70
68
|
|
|
71
69
|
expect{Pkg::Repo.create_signed_repo_archive("/path", "project-debian-6-i386", "version")}.not_to raise_error
|
|
72
70
|
end
|
|
73
71
|
|
|
74
|
-
it
|
|
75
|
-
allow(Pkg::Util::Tool).to receive(:check_tool).and_return(
|
|
76
|
-
allow(Pkg::Config).to receive(:project).and_return(
|
|
77
|
-
allow(Pkg::Util::Version).to receive(:dot_version).and_return(
|
|
78
|
-
allow(Dir).to receive(:chdir).with(
|
|
79
|
-
allow(Dir).to receive(:chdir).with("project/1.1.1").and_yield
|
|
72
|
+
it 'should invoke tar correctly' do
|
|
73
|
+
allow(Pkg::Util::Tool).to receive(:check_tool).and_return('tarcommand')
|
|
74
|
+
allow(Pkg::Config).to receive(:project).and_return('project')
|
|
75
|
+
allow(Pkg::Util::Version).to receive(:dot_version).and_return('1.1.1')
|
|
76
|
+
allow(Dir).to receive(:chdir).with('pkg/project/1.1.1').and_yield
|
|
80
77
|
allow(Pkg::Util::File).to receive(:empty_dir?).and_return(false)
|
|
81
78
|
|
|
82
|
-
expect(Pkg::Util::Execution).to receive(:capture3).with(
|
|
83
|
-
Pkg::Repo.create_signed_repo_archive(
|
|
79
|
+
expect(Pkg::Util::Execution).to receive(:capture3).with('tarcommand --owner=0 --group=0 --create --gzip --file repos/project-debian-6-i386.tar.gz /path')
|
|
80
|
+
Pkg::Repo.create_signed_repo_archive('/path', 'project-debian-6-i386', 'version')
|
|
84
81
|
end
|
|
85
82
|
end
|
|
86
83
|
|
|
87
|
-
describe
|
|
88
|
-
it
|
|
84
|
+
describe '#create_signed_repo_archive' do
|
|
85
|
+
it 'should invoke create_signed_repo_archive correctly for multiple entries in platform_repos' do
|
|
89
86
|
allow(Pkg::Config).to receive(:platform_repos).and_return(platform_repo_stub)
|
|
87
|
+
allow(Pkg::Config).to receive(:project).and_return('project')
|
|
88
|
+
allow(Pkg::Util::Version).to receive(:dot_version).and_return('1.1.1')
|
|
89
|
+
allow(Dir).to receive(:chdir).with('pkg/project/1.1.1').and_yield
|
|
90
|
+
|
|
91
|
+
expect(Pkg::Repo).to receive(:create_signed_repo_archive).with('repos/el/4/**/i386', 'project-el-4-i386', 'version')
|
|
92
|
+
expect(Pkg::Repo).to receive(:create_signed_repo_archive).with('repos/el/5/**/i386', 'project-el-5-i386', 'version')
|
|
93
|
+
expect(Pkg::Repo).to receive(:create_signed_repo_archive).with('repos/el/6/**/i386', 'project-el-6-i386', 'version')
|
|
90
94
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
expect(Pkg::Repo).to receive(:create_signed_repo_archive).with("repos/el/6/**/i386", "project-el-6-i386", "version")
|
|
94
|
-
Pkg::Repo.create_all_repo_archives("project", "version")
|
|
95
|
+
allow(Pkg::Util::Execution).to receive(:capture3)
|
|
96
|
+
Pkg::Repo.create_all_repo_archives('project', 'version')
|
|
95
97
|
end
|
|
96
98
|
end
|
|
97
99
|
|
data/tasks/nightly_repos.rake
CHANGED
|
@@ -68,60 +68,6 @@ DOC
|
|
|
68
68
|
Pkg::Repo.create_all_repo_archives(name_of_archive, versioning)
|
|
69
69
|
end
|
|
70
70
|
|
|
71
|
-
# This is pretty similar to the 'pack_signed_repo' task. The difference here is that instead
|
|
72
|
-
# of creating a tarball for each repo passed, it adds each repo to a single archive, creating
|
|
73
|
-
# one 'all' tarball with all of the repos. This is useful for cutomers who have a PE master with
|
|
74
|
-
# no internet access. They can unpack the puppet-agent-all tarball into the location that
|
|
75
|
-
# pe_repo expects and use simplified agent install without needing internet access, or having to
|
|
76
|
-
# manually download each agent that they need to feed to pe_repo.
|
|
77
|
-
# This task should be invoked after prepare_signed_repos, so that there are repos to pack up.
|
|
78
|
-
task :pack_all_signed_repos, [:path_to_repo, :name_of_archive, :versioning] => ["pl:fetch"] do |t, args|
|
|
79
|
-
# path_to_repo should be relative to ./pkg
|
|
80
|
-
name_of_archive = args.name_of_archive or fail ":name_of_archive is a required argument for #{t}"
|
|
81
|
-
versioning = args.versioning or fail ":versioning is a required argument for #{t}"
|
|
82
|
-
tar = Pkg::Util::Tool.check_tool('tar')
|
|
83
|
-
|
|
84
|
-
Dir.chdir("pkg") do
|
|
85
|
-
if versioning == 'ref'
|
|
86
|
-
local_target = File.join(Pkg::Config.project, Pkg::Config.ref, "repos")
|
|
87
|
-
elsif versioning == 'version'
|
|
88
|
-
local_target = File.join(Pkg::Config.project, Pkg::Util::Version.dot_version, "repos")
|
|
89
|
-
end
|
|
90
|
-
|
|
91
|
-
Dir.chdir(local_target) do
|
|
92
|
-
if !Pkg::Util::File.exist?("#{name_of_archive}.tar.gz")
|
|
93
|
-
warn "Skipping #{name_of_archive} because it (#{name_of_archive}.tar.gz) has no files"
|
|
94
|
-
else
|
|
95
|
-
if File.exist?("#{Pkg::Config.project}-all.tar")
|
|
96
|
-
tar_cmd = "--update"
|
|
97
|
-
else
|
|
98
|
-
tar_cmd = "--create"
|
|
99
|
-
end
|
|
100
|
-
Pkg::Util::Execution.ex("#{tar} --owner=0 --group=0 #{tar_cmd} --file #{Pkg::Config.project}-all.tar #{name_of_archive}.tar.gz")
|
|
101
|
-
end
|
|
102
|
-
end
|
|
103
|
-
end
|
|
104
|
-
end
|
|
105
|
-
|
|
106
|
-
# tar does not support adding or updating files in a compressed archive, so
|
|
107
|
-
# we have a task to compress the "all" tarball from the 'pack_all_signed_repos'
|
|
108
|
-
# task
|
|
109
|
-
task :compress_the_all_tarball, [:versioning] => ["pl:fetch"] do |t, args|
|
|
110
|
-
versioning = args.versioning or fail ":versioning is a required argument for #{t}"
|
|
111
|
-
gzip = Pkg::Util::Tool.check_tool('gzip')
|
|
112
|
-
Dir.chdir("pkg") do
|
|
113
|
-
if versioning == 'ref'
|
|
114
|
-
local_target = File.join(Pkg::Config.project, Pkg::Config.ref)
|
|
115
|
-
elsif versioning == 'version'
|
|
116
|
-
local_target = File.join(Pkg::Config.project, Pkg::Util::Version.dot_version)
|
|
117
|
-
end
|
|
118
|
-
Dir.chdir(local_target) do
|
|
119
|
-
Pkg::Util::Execution.ex("#{gzip} --fast #{File.join("repos", "#{Pkg::Config.project}-all.tar")}")
|
|
120
|
-
end
|
|
121
|
-
end
|
|
122
|
-
end
|
|
123
|
-
|
|
124
|
-
|
|
125
71
|
task :prepare_signed_repos, [:target_host, :target_prefix, :versioning] => ["clean", "pl:fetch"] do |t, args|
|
|
126
72
|
target_host = args.target_host or fail ":target_host is a required argument to #{t}"
|
|
127
73
|
target_prefix = args.target_prefix or fail ":target_prefix is a required argument for #{t}"
|
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.42
|
|
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-
|
|
11
|
+
date: 2019-09-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rspec
|
|
@@ -224,34 +224,33 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
224
224
|
- !ruby/object:Gem::Version
|
|
225
225
|
version: '0'
|
|
226
226
|
requirements: []
|
|
227
|
-
|
|
228
|
-
rubygems_version: 2.6.9
|
|
227
|
+
rubygems_version: 3.0.3
|
|
229
228
|
signing_key:
|
|
230
229
|
specification_version: 4
|
|
231
230
|
summary: Puppet Labs' packaging automation
|
|
232
231
|
test_files:
|
|
233
232
|
- spec/lib/packaging/paths_spec.rb
|
|
234
|
-
- spec/lib/packaging/
|
|
235
|
-
- spec/lib/packaging/
|
|
233
|
+
- spec/lib/packaging/deb/repo_spec.rb
|
|
234
|
+
- spec/lib/packaging/util/misc_spec.rb
|
|
236
235
|
- spec/lib/packaging/util/execution_spec.rb
|
|
237
|
-
- spec/lib/packaging/util/os_spec.rb
|
|
238
|
-
- spec/lib/packaging/util/version_spec.rb
|
|
239
|
-
- spec/lib/packaging/util/git_spec.rb
|
|
240
|
-
- spec/lib/packaging/util/jenkins_spec.rb
|
|
241
|
-
- spec/lib/packaging/util/rake_utils_spec.rb
|
|
242
236
|
- spec/lib/packaging/util/gpg_spec.rb
|
|
237
|
+
- spec/lib/packaging/util/jenkins_spec.rb
|
|
238
|
+
- spec/lib/packaging/util/ship_spec.rb
|
|
243
239
|
- 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
|
|
244
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
245
|
- spec/lib/packaging/util/net_spec.rb
|
|
246
|
-
- spec/lib/packaging/util/misc_spec.rb
|
|
247
|
-
- spec/lib/packaging/util/ship_spec.rb
|
|
248
|
-
- spec/lib/packaging/repo_spec.rb
|
|
249
|
-
- spec/lib/packaging/tar_spec.rb
|
|
250
|
-
- spec/lib/packaging/retrieve_spec.rb
|
|
251
|
-
- spec/lib/packaging/platforms_spec.rb
|
|
252
246
|
- spec/lib/packaging/deb_spec.rb
|
|
253
|
-
- spec/lib/packaging/
|
|
247
|
+
- spec/lib/packaging/platforms_spec.rb
|
|
254
248
|
- spec/lib/packaging/rpm/repo_spec.rb
|
|
255
|
-
- spec/lib/packaging/
|
|
249
|
+
- spec/lib/packaging/sign_spec.rb
|
|
250
|
+
- spec/lib/packaging/retrieve_spec.rb
|
|
251
|
+
- spec/lib/packaging/repo_spec.rb
|
|
256
252
|
- spec/lib/packaging/artifactory_spec.rb
|
|
253
|
+
- spec/lib/packaging/gem_spec.rb
|
|
254
|
+
- spec/lib/packaging/tar_spec.rb
|
|
255
|
+
- spec/lib/packaging/config_spec.rb
|
|
257
256
|
- spec/lib/packaging_spec.rb
|