packaging 0.99.75 → 0.99.79
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 +4 -4
- data/README.md +1 -1
- data/lib/packaging/archive.rb +6 -6
- data/lib/packaging/artifactory.rb +0 -2
- data/lib/packaging/config.rb +31 -1
- data/lib/packaging/config/params.rb +12 -0
- data/lib/packaging/config/validations.rb +13 -0
- data/lib/packaging/deb/repo.rb +5 -5
- data/lib/packaging/paths.rb +2 -1
- data/lib/packaging/platforms.rb +22 -35
- data/lib/packaging/repo.rb +9 -3
- data/lib/packaging/rpm/repo.rb +4 -4
- data/lib/packaging/sign/dmg.rb +68 -30
- data/lib/packaging/sign/ips.rb +8 -8
- data/lib/packaging/sign/msi.rb +9 -6
- data/lib/packaging/util/net.rb +53 -31
- data/lib/packaging/util/ship.rb +4 -4
- data/spec/lib/packaging/artifactory_spec.rb +11 -11
- data/spec/lib/packaging/config_spec.rb +14 -15
- data/spec/lib/packaging/deb/repo_spec.rb +3 -3
- data/spec/lib/packaging/paths_spec.rb +8 -2
- data/spec/lib/packaging/platforms_spec.rb +15 -15
- data/spec/lib/packaging/repo_spec.rb +1 -1
- data/spec/lib/packaging/retrieve_spec.rb +4 -3
- data/spec/lib/packaging/rpm/repo_spec.rb +3 -3
- data/spec/lib/packaging/sign_spec.rb +0 -2
- data/spec/lib/packaging/util/git_tag_spec.rb +1 -1
- data/spec/lib/packaging/util/net_spec.rb +22 -9
- data/spec/lib/packaging/util/ship_spec.rb +2 -2
- data/tasks/archive.rake +3 -4
- data/tasks/config.rake +5 -0
- data/tasks/education.rake +5 -5
- data/tasks/fetch.rake +17 -14
- data/tasks/gem.rake +17 -26
- data/tasks/nightly_repos.rake +9 -9
- data/tasks/pe_ship.rake +11 -19
- data/tasks/ship.rake +46 -46
- data/tasks/sign.rake +3 -3
- metadata +17 -16
|
@@ -4,7 +4,7 @@ describe 'Pkg::Platforms' do
|
|
|
4
4
|
describe '#by_package_format' do
|
|
5
5
|
it 'should return an array of platforms that use a given format' do
|
|
6
6
|
deb_platforms = ['debian', 'ubuntu']
|
|
7
|
-
rpm_platforms = ['aix', '
|
|
7
|
+
rpm_platforms = ['aix', 'el', 'fedora', 'redhatfips', 'sles']
|
|
8
8
|
expect(Pkg::Platforms.by_package_format('deb')).to match_array(deb_platforms)
|
|
9
9
|
expect(Pkg::Platforms.by_package_format('rpm')).to match_array(rpm_platforms)
|
|
10
10
|
end
|
|
@@ -12,14 +12,14 @@ describe 'Pkg::Platforms' do
|
|
|
12
12
|
|
|
13
13
|
describe '#formats' do
|
|
14
14
|
it 'should return all package formats' do
|
|
15
|
-
fmts = ['rpm', 'deb', '
|
|
15
|
+
fmts = ['rpm', 'deb', 'dmg', 'svr4', 'ips', 'msi']
|
|
16
16
|
expect(Pkg::Platforms.formats).to match_array(fmts)
|
|
17
17
|
end
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
describe '#supported_platforms' do
|
|
21
21
|
it 'should return all supported platforms' do
|
|
22
|
-
platforms = ['aix', '
|
|
22
|
+
platforms = ['aix', 'debian', 'el', '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
|
|
@@ -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
|
|
@@ -97,14 +97,16 @@ describe 'Pkg::Platforms' do
|
|
|
97
97
|
end
|
|
98
98
|
|
|
99
99
|
describe '#platform_lookup' do
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
100
|
+
['osx-10.15-x86_64', 'osx-11-x86_64'].each do |platform|
|
|
101
|
+
it 'should return a hash of platform info' do
|
|
102
|
+
expect(Pkg::Platforms.platform_lookup(platform)).to be_instance_of(Hash)
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
it 'should include at least arch and package format keys' do
|
|
106
|
+
expect(Pkg::Platforms.platform_lookup(platform).keys).to include(:architectures)
|
|
107
|
+
expect(Pkg::Platforms.platform_lookup(platform).keys).to include(:package_format)
|
|
108
|
+
end
|
|
109
|
+
end
|
|
108
110
|
end
|
|
109
111
|
|
|
110
112
|
describe '#get_attribute' do
|
|
@@ -113,7 +115,7 @@ describe 'Pkg::Platforms' do
|
|
|
113
115
|
end
|
|
114
116
|
|
|
115
117
|
it 'fails with a reasonable error when specified attribute is not defined' do
|
|
116
|
-
expect { Pkg::Platforms.get_attribute('
|
|
118
|
+
expect { Pkg::Platforms.get_attribute('osx-10.15-x86_64', :signature_format) }.to raise_error(/doesn't have information/)
|
|
117
119
|
end
|
|
118
120
|
end
|
|
119
121
|
|
|
@@ -129,8 +131,6 @@ describe 'Pkg::Platforms' do
|
|
|
129
131
|
'windows-2012-x86' => ['windows', '2012', 'x86'],
|
|
130
132
|
'windowsfips-2012-x64' => ['windowsfips', '2012', 'x64'],
|
|
131
133
|
'el-7-x86_64' => ['el', '7', 'x86_64'],
|
|
132
|
-
'cisco-wrlinux-7-x86_64' => ['cisco-wrlinux', '7', 'x86_64'],
|
|
133
|
-
'cisco-wrlinux-7' => ['cisco-wrlinux', '7', ''],
|
|
134
134
|
'el-6' => ['el', '6', ''],
|
|
135
135
|
'xenial-amd64' => ['ubuntu', '16.04', 'amd64'],
|
|
136
136
|
'xenial' => ['ubuntu', '16.04', ''],
|
|
@@ -128,7 +128,7 @@ describe "#Pkg::Repo" do
|
|
|
128
128
|
end
|
|
129
129
|
|
|
130
130
|
it 'should execute command if optional params are nil' do
|
|
131
|
-
expect(Pkg::Util::Net).to receive(:
|
|
131
|
+
expect(Pkg::Util::Net).to receive(:remote_execute).with(remote_host, "some command with #{repo_name} and #{repo_path} and stuff")
|
|
132
132
|
Pkg::Repo.update_repo(remote_host, repo_command, { :repo_name => repo_name, :repo_path => repo_path })
|
|
133
133
|
end
|
|
134
134
|
end
|
|
@@ -7,11 +7,12 @@ describe 'Pkg::Retrieve' do
|
|
|
7
7
|
remote_target = 'repos'
|
|
8
8
|
project = 'puppet-agent'
|
|
9
9
|
ref = 'b25e64984dd505391f248fe5501ad81e2645b6d2'
|
|
10
|
-
foss_platforms = ['el-7-x86_64', 'ubuntu-16.04-amd64', 'osx-10.11-x86_64', 'windows-2012-x64']
|
|
10
|
+
foss_platforms = ['el-7-x86_64', 'ubuntu-16.04-amd64', 'osx-10.15-x86_64', 'osx-11-x86_64', 'windows-2012-x64']
|
|
11
11
|
platform_data = {:platform_data => {
|
|
12
|
-
'aix-
|
|
12
|
+
'aix-7.1-power' => {:artifact => './aix/7.1/PC1/ppc/puppet-agent-5.3.2.155.gb25e649-1.aix7.1.ppc.rpm'},
|
|
13
13
|
'el-7-x86_64' => {:artifact => './el/7/PC1/x86_64/puppet-agent-5.3.2.155.gb25e649-1.el7.x86_64.rpm'},
|
|
14
|
-
'osx-10.
|
|
14
|
+
'osx-10.15-x86_64' => {:artifact => './apple/10.15/PC1/x86_64/puppet-agent-5.3.2.155.gb25e649-1.osx10.15.dmg'},
|
|
15
|
+
'osx-11-x86_64' => {:artifact => './apple/11/PC1/x86_64/puppet-agent-5.3.2.155.gb25e649-1.osx11.dmg'},
|
|
15
16
|
'sles-11-i386' => {:artifact => './sles/11/PC1/i386/puppet-agent-5.3.2.155.gb25e649-1.sles11.i386.rpm'},
|
|
16
17
|
'solaris-10-sparc' => {:artifact => './solaris/10/PC1/puppet-agent-5.3.2.155.gb25e649-1.sparc.pkg.gz'},
|
|
17
18
|
'ubuntu-16.04-amd64' => {:artifact => './deb/xenial/PC1/puppet-agent_5.3.2.155.gb25e649-1xenial_amd64.deb'},
|
|
@@ -102,10 +102,10 @@ describe "Pkg::Rpm::Repo" do
|
|
|
102
102
|
Pkg::Repo.should_receive(:directories_that_contain_packages).and_return(pkg_directories)
|
|
103
103
|
Pkg::Repo.should_receive(:populate_repo_directory)
|
|
104
104
|
Pkg::Rpm::Repo.should_receive(:repo_creation_command).and_return(command)
|
|
105
|
-
Pkg::Util::Net.should_receive(:
|
|
105
|
+
Pkg::Util::Net.should_receive(:remote_execute).with(Pkg::Config.distribution_server, command)
|
|
106
106
|
Pkg::Rpm::Repo.should_receive(:generate_repo_configs)
|
|
107
107
|
Pkg::Rpm::Repo.should_receive(:ship_repo_configs)
|
|
108
|
-
Pkg::Util::Net.should_receive(:
|
|
108
|
+
Pkg::Util::Net.should_receive(:remote_execute).with(Pkg::Config.distribution_server, "rm -f #{artifact_directory}/repos/.lock" )
|
|
109
109
|
Pkg::Rpm::Repo.create_remote_repos
|
|
110
110
|
end
|
|
111
111
|
end
|
|
@@ -125,7 +125,7 @@ describe "Pkg::Rpm::Repo" do
|
|
|
125
125
|
repo_dir = "#{Pkg::Config.jenkins_repo_path}/#{Pkg::Config.project}/#{Pkg::Config.ref}/repo_configs/rpm"
|
|
126
126
|
Pkg::Util::File.should_receive(:empty_dir?).with("pkg/repo_configs/rpm").and_return(false)
|
|
127
127
|
Pkg::Util::RakeUtils.should_receive(:invoke_task).with("pl:fetch")
|
|
128
|
-
Pkg::Util::Net.should_receive(:
|
|
128
|
+
Pkg::Util::Net.should_receive(:remote_execute).with(Pkg::Config.distribution_server, "mkdir -p #{repo_dir}")
|
|
129
129
|
Pkg::Util::Execution.should_receive(:retry_on_fail).with(:times => 3)
|
|
130
130
|
Pkg::Rpm::Repo.ship_repo_configs
|
|
131
131
|
end
|
|
@@ -65,7 +65,6 @@ DOC
|
|
|
65
65
|
describe '#sign_all' do
|
|
66
66
|
let(:rpm_directory) { 'foo' }
|
|
67
67
|
let(:rpms_not_to_sign) { [
|
|
68
|
-
"#{rpm_directory}/aix/6.1/PC1/ppc/puppet-agent-5.5.3-1.aix6.1.ppc.rpm",
|
|
69
68
|
"#{rpm_directory}/aix/7.1/PC1/ppc/puppet-agent-5.5.3-1.aix7.1.ppc.rpm",
|
|
70
69
|
] }
|
|
71
70
|
let(:v3_rpms) { [
|
|
@@ -77,7 +76,6 @@ DOC
|
|
|
77
76
|
] }
|
|
78
77
|
let(:rpms) { rpms_not_to_sign + v3_rpms + v4_rpms }
|
|
79
78
|
let(:already_signed_rpms) { [
|
|
80
|
-
"#{rpm_directory}/cisco-wrlinux/7/PC1/x86_64/puppet-agent-5.5.3-1.cisco_wrlinux7.x86_64.rpm",
|
|
81
79
|
"#{rpm_directory}/el/6/PC1/x86_64/puppet-agent-5.5.3-1.el6.x86_64.rpm",
|
|
82
80
|
] }
|
|
83
81
|
let(:noarch_rpms) { [
|
|
@@ -17,7 +17,7 @@ describe "Pkg::Util::Git_tag" do
|
|
|
17
17
|
|
|
18
18
|
context "branch?" do
|
|
19
19
|
it "sets ref type as a branch when passed a branch" do
|
|
20
|
-
git_tag = Pkg::Util::Git_tag.new("git://github.com/puppetlabs/leatherman.git", "
|
|
20
|
+
git_tag = Pkg::Util::Git_tag.new("git://github.com/puppetlabs/leatherman.git", "main")
|
|
21
21
|
expect(git_tag.branch?).to eq(true)
|
|
22
22
|
end
|
|
23
23
|
end
|
|
@@ -54,24 +54,35 @@ describe "Pkg::Util::Net" do
|
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
describe "remote_ssh_cmd" do
|
|
57
|
+
it "should be able to call via deprecated shim" do
|
|
58
|
+
Pkg::Util::Tool.should_receive(:check_tool).with("ssh").and_return(ssh)
|
|
59
|
+
Pkg::Util::Execution.should_receive(:capture3).with("#{ssh} -t foo 'set -e;bar'")
|
|
60
|
+
Pkg::Util::Execution.should_receive(:success?).and_return(true)
|
|
61
|
+
Pkg::Util::Net.remote_ssh_cmd("foo", "bar", true)
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
describe "remote_execute" do
|
|
57
66
|
it "should fail if ssh is not present" do
|
|
58
67
|
Pkg::Util::Tool.stub(:find_tool).with("ssh") { fail }
|
|
59
68
|
Pkg::Util::Tool.should_receive(:check_tool).with("ssh").and_raise(RuntimeError)
|
|
60
|
-
expect{ Pkg::Util::Net.
|
|
69
|
+
expect{ Pkg::Util::Net.remote_execute("foo", "bar") }.to raise_error(RuntimeError)
|
|
61
70
|
end
|
|
62
71
|
|
|
63
72
|
it "should be able to not fail fast" do
|
|
64
73
|
Pkg::Util::Tool.should_receive(:check_tool).with("ssh").and_return(ssh)
|
|
65
74
|
Kernel.should_receive(:system).with("#{ssh} -t foo 'bar'")
|
|
66
75
|
Pkg::Util::Execution.should_receive(:success?).and_return(true)
|
|
67
|
-
Pkg::Util::Net.
|
|
76
|
+
Pkg::Util::Net.remote_execute(
|
|
77
|
+
"foo", "bar", capture_output: false, extra_options: '', fail_fast: false)
|
|
68
78
|
end
|
|
69
79
|
|
|
70
80
|
it "should be able to trace output" do
|
|
71
81
|
Pkg::Util::Tool.should_receive(:check_tool).with("ssh").and_return(ssh)
|
|
72
82
|
Kernel.should_receive(:system).with("#{ssh} -t foo 'set -x;bar'")
|
|
73
83
|
Pkg::Util::Execution.should_receive(:success?).and_return(true)
|
|
74
|
-
Pkg::Util::Net.
|
|
84
|
+
Pkg::Util::Net.remote_execute(
|
|
85
|
+
"foo", "bar", capture_output: false, fail_fast: false, trace: true)
|
|
75
86
|
end
|
|
76
87
|
|
|
77
88
|
context "without output captured" do
|
|
@@ -79,21 +90,22 @@ describe "Pkg::Util::Net" do
|
|
|
79
90
|
Pkg::Util::Tool.should_receive(:check_tool).with("ssh").and_return(ssh)
|
|
80
91
|
Kernel.should_receive(:system).with("#{ssh} -t foo 'set -e;bar'")
|
|
81
92
|
Pkg::Util::Execution.should_receive(:success?).and_return(true)
|
|
82
|
-
Pkg::Util::Net.
|
|
93
|
+
Pkg::Util::Net.remote_execute("foo", "bar")
|
|
83
94
|
end
|
|
84
95
|
|
|
85
96
|
it "should escape single quotes in the command" do
|
|
86
97
|
Pkg::Util::Tool.should_receive(:check_tool).with("ssh").and_return(ssh)
|
|
87
98
|
Kernel.should_receive(:system).with("#{ssh} -t foo 'set -e;b'\\''ar'")
|
|
88
99
|
Pkg::Util::Execution.should_receive(:success?).and_return(true)
|
|
89
|
-
Pkg::Util::Net.
|
|
100
|
+
Pkg::Util::Net.remote_execute("foo", "b'ar")
|
|
90
101
|
end
|
|
91
102
|
|
|
92
103
|
it "should raise an error if ssh fails" do
|
|
93
104
|
Pkg::Util::Tool.should_receive(:check_tool).with("ssh").and_return(ssh)
|
|
94
105
|
Kernel.should_receive(:system).with("#{ssh} -t foo 'set -e;bar'")
|
|
95
106
|
Pkg::Util::Execution.should_receive(:success?).and_return(false)
|
|
96
|
-
expect{ Pkg::Util::Net.
|
|
107
|
+
expect{ Pkg::Util::Net.remote_execute("foo", "bar") }
|
|
108
|
+
.to raise_error(RuntimeError, /failed./)
|
|
97
109
|
end
|
|
98
110
|
end
|
|
99
111
|
|
|
@@ -102,21 +114,22 @@ describe "Pkg::Util::Net" do
|
|
|
102
114
|
Pkg::Util::Tool.should_receive(:check_tool).with("ssh").and_return(ssh)
|
|
103
115
|
Pkg::Util::Execution.should_receive(:capture3).with("#{ssh} -t foo 'set -e;bar'")
|
|
104
116
|
Pkg::Util::Execution.should_receive(:success?).and_return(true)
|
|
105
|
-
Pkg::Util::Net.
|
|
117
|
+
Pkg::Util::Net.remote_execute("foo", "bar", capture_output: true)
|
|
106
118
|
end
|
|
107
119
|
|
|
108
120
|
it "should escape single quotes in the command" do
|
|
109
121
|
Pkg::Util::Tool.should_receive(:check_tool).with("ssh").and_return(ssh)
|
|
110
122
|
Pkg::Util::Execution.should_receive(:capture3).with("#{ssh} -t foo 'set -e;b'\\''ar'")
|
|
111
123
|
Pkg::Util::Execution.should_receive(:success?).and_return(true)
|
|
112
|
-
Pkg::Util::Net.
|
|
124
|
+
Pkg::Util::Net.remote_execute("foo", "b'ar", capture_output: true)
|
|
113
125
|
end
|
|
114
126
|
|
|
115
127
|
it "should raise an error if ssh fails" do
|
|
116
128
|
Pkg::Util::Tool.should_receive(:check_tool).with("ssh").and_return(ssh)
|
|
117
129
|
Pkg::Util::Execution.should_receive(:capture3).with("#{ssh} -t foo 'set -e;bar'")
|
|
118
130
|
Pkg::Util::Execution.should_receive(:success?).and_return(false)
|
|
119
|
-
expect{ Pkg::Util::Net.
|
|
131
|
+
expect{ Pkg::Util::Net.remote_execute("foo", "bar", capture_output: true) }
|
|
132
|
+
.to raise_error(RuntimeError, /failed./)
|
|
120
133
|
end
|
|
121
134
|
end
|
|
122
135
|
end
|
|
@@ -126,7 +126,7 @@ describe '#Pkg::Util::Ship' do
|
|
|
126
126
|
# All of these expects must be called in the same block in order for the
|
|
127
127
|
# tests to work without actually shipping anything
|
|
128
128
|
expect(Pkg::Util::Net)
|
|
129
|
-
.to receive(:
|
|
129
|
+
.to receive(:remote_execute)
|
|
130
130
|
.with(test_staging_server, /#{test_remote_path}/)
|
|
131
131
|
.exactly(retrieved_packages.count).times
|
|
132
132
|
expect(Pkg::Util::Net)
|
|
@@ -167,7 +167,7 @@ describe '#Pkg::Util::Ship' do
|
|
|
167
167
|
# All of these expects must be called in the same block in order for the
|
|
168
168
|
# tests to work without actually shipping anything
|
|
169
169
|
expect(Pkg::Util::Net)
|
|
170
|
-
.to receive(:
|
|
170
|
+
.to receive(:remote_execute)
|
|
171
171
|
.with(test_staging_server, /#{test_remote_path}/)
|
|
172
172
|
expect(Pkg::Util::Net)
|
|
173
173
|
.to receive(:rsync_to)
|
data/tasks/archive.rake
CHANGED
|
@@ -39,7 +39,7 @@ namespace :pl do
|
|
|
39
39
|
task :deploy_staged_apt_archives_to_s3 => 'pl:fetch' do
|
|
40
40
|
command = 'sudo /usr/local/bin/s3_repo_sync.sh release-archives.puppet.com/apt'
|
|
41
41
|
Pkg::Util::Execution.retry_on_fail(:times => 3) do
|
|
42
|
-
Pkg::Util::Net.
|
|
42
|
+
Pkg::Util::Net.remote_execute(Pkg::Config.staging_server, command)
|
|
43
43
|
end
|
|
44
44
|
end
|
|
45
45
|
|
|
@@ -47,7 +47,7 @@ namespace :pl do
|
|
|
47
47
|
task :deploy_staged_yum_archives_to_s3 => 'pl:fetch' do
|
|
48
48
|
command = 'sudo /usr/local/bin/s3_repo_sync.sh release-archives.puppet.com/yum'
|
|
49
49
|
Pkg::Util::Execution.retry_on_fail(:times => 3) do
|
|
50
|
-
Pkg::Util::Net.
|
|
50
|
+
Pkg::Util::Net.remote_execute(Pkg::Config.staging_server, command)
|
|
51
51
|
end
|
|
52
52
|
end
|
|
53
53
|
|
|
@@ -55,7 +55,7 @@ namespace :pl do
|
|
|
55
55
|
task :deploy_staged_downloads_archives_to_s3 => 'pl:fetch' do
|
|
56
56
|
command = 'sudo /usr/local/bin/s3_repo_sync.sh release-archives.puppet.com/downloads'
|
|
57
57
|
Pkg::Util::Execution.retry_on_fail(:times => 3) do
|
|
58
|
-
Pkg::Util::Net.
|
|
58
|
+
Pkg::Util::Net.remote_execute(Pkg::Config.staging_server, command)
|
|
59
59
|
end
|
|
60
60
|
end
|
|
61
61
|
|
|
@@ -67,4 +67,3 @@ namespace :pl do
|
|
|
67
67
|
end
|
|
68
68
|
end
|
|
69
69
|
end
|
|
70
|
-
|
data/tasks/config.rake
CHANGED
|
@@ -6,6 +6,11 @@ namespace :config do
|
|
|
6
6
|
end
|
|
7
7
|
end
|
|
8
8
|
|
|
9
|
+
desc "validate Pkg::Config values for this repo"
|
|
10
|
+
task :validate do
|
|
11
|
+
Pkg::Config.perform_validations
|
|
12
|
+
end
|
|
13
|
+
|
|
9
14
|
task :print_hosts => 'pl:fetch' do
|
|
10
15
|
Pkg::Util.filter_configs('host').each do |key, value|
|
|
11
16
|
puts "#{key}: #{value}"
|
data/tasks/education.rake
CHANGED
|
@@ -35,7 +35,7 @@ namespace :pl do
|
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
# If the archive directory exists, move old VMs to it
|
|
38
|
-
Pkg::Util::Net.
|
|
38
|
+
Pkg::Util::Net.remote_execute(target_host, "if [ -d #{target_directory}/archive ]; then #{archive_cmd}; fi")
|
|
39
39
|
|
|
40
40
|
# Ship VM and md5 to host
|
|
41
41
|
Pkg::Util::Net.rsync_to(vm, target_host, target_directory)
|
|
@@ -45,10 +45,10 @@ namespace :pl do
|
|
|
45
45
|
link_target.each do |link|
|
|
46
46
|
link_path = File.join(target_directory, link)
|
|
47
47
|
link_md5_path = "#{link_path}.md5"
|
|
48
|
-
Pkg::Util::Net.
|
|
49
|
-
Pkg::Util::Net.
|
|
50
|
-
Pkg::Util::Net.
|
|
51
|
-
Pkg::Util::Net.
|
|
48
|
+
Pkg::Util::Net.remote_execute(target_host, "if [[ -L '#{link_path}' ]] && [[ ! -e '#{link_path}' ]] ; then echo '#{link_path} is a broken link, deleting' ; unlink '#{link_path}' ; fi")
|
|
49
|
+
Pkg::Util::Net.remote_execute(target_host, "if [[ -L '#{link_md5_path}' ]] && [[ ! -e '#{link_md5_path}' ]] ; then echo '#{link_md5_path} is a broken link, deleting' ; unlink '#{link_md5_path}' ; fi")
|
|
50
|
+
Pkg::Util::Net.remote_execute(target_host, "cd #{target_directory} ; ln -sf #{File.basename(vm)} #{link}")
|
|
51
|
+
Pkg::Util::Net.remote_execute(target_host, "cd #{target_directory} ; ln -sf #{File.basename(md5)} #{link}.md5")
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
puts "'#{vm}' and '#{md5}' have been shipped via rsync to '#{target_host}/#{target_directory}'"
|
data/tasks/fetch.rake
CHANGED
|
@@ -30,28 +30,31 @@ namespace :pl do
|
|
|
30
30
|
task :fetch do
|
|
31
31
|
# Remove .packaging directory from old-style extras loading
|
|
32
32
|
rm_rf "#{ENV['HOME']}/.packaging" if File.directory?("#{ENV['HOME']}/.packaging")
|
|
33
|
+
|
|
33
34
|
# Touch the .packaging file which is allows packaging to present remote tasks
|
|
34
35
|
touch "#{ENV['HOME']}/.packaging"
|
|
35
36
|
|
|
36
37
|
begin
|
|
37
|
-
|
|
38
|
-
%x(git clone #{data_repo} #{
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
38
|
+
build_data_directory = Pkg::Util::File.mktemp
|
|
39
|
+
%x(git clone #{data_repo} #{build_data_directory})
|
|
40
|
+
unless $?.success?
|
|
41
|
+
fail 'Error: could not fetch the build-data repo. Maybe you do not have the correct permissions?'
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
Dir.chdir(build_data_directory) do
|
|
45
|
+
[team_data_branch, project_data_branch].each do |branch|
|
|
46
|
+
%x(git checkout #{branch})
|
|
47
|
+
unless $?.success?
|
|
48
|
+
warn "Warning: no build_defaults found in branch '#{branch}' of '#{data_repo}'. Skipping."
|
|
49
|
+
next
|
|
48
50
|
end
|
|
51
|
+
Pkg::Util::RakeUtils.invoke_task('pl:load_extras', build_data_directory)
|
|
49
52
|
end
|
|
50
|
-
else
|
|
51
|
-
fail "There was an error attempting to fetch the build-data repo. Maybe you do not have the correct permissions?"
|
|
52
53
|
end
|
|
53
54
|
ensure
|
|
54
|
-
rm_rf
|
|
55
|
+
rm_rf build_data_directory
|
|
55
56
|
end
|
|
57
|
+
|
|
58
|
+
Pkg::Util::RakeUtils.invoke_task('config:validate')
|
|
56
59
|
end
|
|
57
60
|
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?
|
|
@@ -150,20 +151,10 @@ namespace :package do
|
|
|
150
151
|
Pkg::Config.gemversion = Pkg::Util::Version.extended_dot_version
|
|
151
152
|
package_gem
|
|
152
153
|
end
|
|
153
|
-
|
|
154
|
-
# PA-3356: temporary task to ship puppet 7 nightly gem
|
|
155
|
-
# TODO: PA-3358 - remove when puppet 7 is officialy out
|
|
156
|
-
task :puppet_7_nightly_gem => ["clean"] do
|
|
157
|
-
Pkg::Config.gemversion = Pkg::Util::Version.extended_dot_version.gsub(/6\.\d+\.\d+/, '7.0.0')
|
|
158
|
-
package_gem
|
|
159
|
-
end
|
|
160
154
|
end
|
|
161
155
|
|
|
162
156
|
# An alias task to simplify our remote logic in jenkins.rake
|
|
163
157
|
namespace :pl do
|
|
164
158
|
task :gem => "package:gem"
|
|
165
159
|
task :nightly_gem => "package:nightly_gem"
|
|
166
|
-
# PA-3356: temporary task to ship puppet 7 nightly gem
|
|
167
|
-
# TODO: PA-3358 - remove when puppet 7 is officialy out
|
|
168
|
-
task :puppet_7_nightly_gem => "package:puppet_7_nightly_gem"
|
|
169
160
|
end
|
data/tasks/nightly_repos.rake
CHANGED
|
@@ -26,10 +26,10 @@ cd #{remote_repo} ;
|
|
|
26
26
|
#{Pkg::Util::Net.remote_bundle_install_command}
|
|
27
27
|
bundle exec rake pl:jenkins:sign_repos GPG_KEY=#{Pkg::Util::Gpg.key} PARAMS_FILE=#{build_params}
|
|
28
28
|
DOC
|
|
29
|
-
Pkg::Util::Net.
|
|
29
|
+
Pkg::Util::Net.remote_execute(signing_server, rake_command)
|
|
30
30
|
Pkg::Util::Net.rsync_from("#{remote_repo}/repos/", signing_server, target)
|
|
31
|
-
Pkg::Util::Net.
|
|
32
|
-
Pkg::Util::Net.
|
|
31
|
+
Pkg::Util::Net.remote_execute(signing_server, "rm -rf #{remote_repo}")
|
|
32
|
+
Pkg::Util::Net.remote_execute(signing_server, "rm #{build_params}")
|
|
33
33
|
puts "Signed packages staged in '#{target}' directory"
|
|
34
34
|
end
|
|
35
35
|
|
|
@@ -48,7 +48,7 @@ DOC
|
|
|
48
48
|
target_dir = "#{Pkg::Config.jenkins_repo_path}/#{Pkg::Config.project}/#{Pkg::Config.ref}/#{target_prefix}_repos"
|
|
49
49
|
Pkg::Util::Execution.retry_on_fail(:times => 3) do
|
|
50
50
|
# Ship the now signed repos to the distribution server
|
|
51
|
-
Pkg::Util::Net.
|
|
51
|
+
Pkg::Util::Net.remote_execute(Pkg::Config.distribution_server, "mkdir -p #{target_dir}")
|
|
52
52
|
Pkg::Util::Net.rsync_to("#{target_prefix}_repos/", Pkg::Config.distribution_server, target_dir)
|
|
53
53
|
end
|
|
54
54
|
end
|
|
@@ -244,11 +244,11 @@ DOC
|
|
|
244
244
|
local_pa_latest = "#{pa_source}-latest"
|
|
245
245
|
local_pe_latest = "#{pe_target}-latest"
|
|
246
246
|
|
|
247
|
-
Pkg::Util::Net.
|
|
248
|
-
Pkg::Util::Net.
|
|
249
|
-
Pkg::Util::Net.
|
|
250
|
-
Pkg::Util::Net.
|
|
251
|
-
Pkg::Util::Net.
|
|
247
|
+
Pkg::Util::Net.remote_execute(target_host, "mkdir -p '#{pe_target}'")
|
|
248
|
+
Pkg::Util::Net.remote_execute(target_host, "mkdir -p '#{local_pe_latest}'")
|
|
249
|
+
Pkg::Util::Net.remote_execute(target_host, "cp -r #{local_pa_latest}/* #{local_pe_latest}")
|
|
250
|
+
Pkg::Util::Net.remote_execute(target_host, "sed -i 's|/#{File.basename(local_pa_latest)}|/#{pe_version}/#{File.basename(local_pa_latest)}|' #{local_pe_latest}/repo_configs/*/*")
|
|
251
|
+
Pkg::Util::Net.remote_execute(target_host, "ln -sf '#{local_pa}' '#{local_pe}'")
|
|
252
252
|
end
|
|
253
253
|
|
|
254
254
|
task :nightly_repos => ["pl:fetch"] do
|