packaging 0.99.61 → 0.99.66
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 +14 -82
- data/lib/packaging/artifactory/extensions.rb +94 -0
- data/lib/packaging/paths.rb +92 -82
- data/lib/packaging/platforms.rb +4 -110
- data/lib/packaging/util/ship.rb +30 -18
- data/spec/lib/packaging/artifactory_spec.rb +8 -11
- data/spec/lib/packaging/config_spec.rb +7 -9
- data/spec/lib/packaging/paths_spec.rb +19 -38
- data/spec/lib/packaging/platforms_spec.rb +12 -12
- data/spec/lib/packaging/retrieve_spec.rb +1 -1
- data/spec/lib/packaging/sign_spec.rb +0 -1
- data/spec/lib/packaging/util/ship_spec.rb +2 -6
- data/tasks/ship.rake +19 -39
- metadata +19 -18
data/lib/packaging/platforms.rb
CHANGED
@@ -47,26 +47,7 @@ module Pkg
|
|
47
47
|
},
|
48
48
|
},
|
49
49
|
|
50
|
-
'cumulus' => {
|
51
|
-
'2.2' => {
|
52
|
-
codename: 'cumulus',
|
53
|
-
architectures: ['amd64'],
|
54
|
-
source_architecture: 'source',
|
55
|
-
package_format: 'deb',
|
56
|
-
source_package_formats: DEBIAN_SOURCE_FORMATS,
|
57
|
-
repo: true,
|
58
|
-
},
|
59
|
-
},
|
60
|
-
|
61
50
|
'debian' => {
|
62
|
-
'7' => {
|
63
|
-
codename: 'wheezy',
|
64
|
-
architectures: ['amd64', 'i386'],
|
65
|
-
source_architecture: 'source',
|
66
|
-
package_format: 'deb',
|
67
|
-
source_package_formats: DEBIAN_SOURCE_FORMATS,
|
68
|
-
repo: true,
|
69
|
-
},
|
70
51
|
'8' => {
|
71
52
|
codename: 'jessie',
|
72
53
|
architectures: ['amd64', 'i386', 'powerpc'],
|
@@ -103,7 +84,7 @@ module Pkg
|
|
103
84
|
repo: true,
|
104
85
|
},
|
105
86
|
'6' => {
|
106
|
-
architectures: ['x86_64', 'i386'
|
87
|
+
architectures: ['x86_64', 'i386'],
|
107
88
|
source_architecture: 'SRPMS',
|
108
89
|
package_format: 'rpm',
|
109
90
|
source_package_formats: ['src.rpm'],
|
@@ -111,7 +92,7 @@ module Pkg
|
|
111
92
|
repo: true,
|
112
93
|
},
|
113
94
|
'7' => {
|
114
|
-
architectures: ['x86_64', '
|
95
|
+
architectures: ['x86_64', 'ppc64le', 'aarch64'],
|
115
96
|
source_architecture: 'SRPMS',
|
116
97
|
package_format: 'rpm',
|
117
98
|
source_package_formats: ['src.rpm'],
|
@@ -137,78 +118,6 @@ module Pkg
|
|
137
118
|
},
|
138
119
|
|
139
120
|
'fedora' => {
|
140
|
-
'f25' => {
|
141
|
-
architectures: ['x86_64', 'i386'],
|
142
|
-
source_architecture: 'SRPMS',
|
143
|
-
package_format: 'rpm',
|
144
|
-
source_package_formats: ['src.rpm'],
|
145
|
-
signature_format: 'v4',
|
146
|
-
repo: true,
|
147
|
-
},
|
148
|
-
'f26' => {
|
149
|
-
architectures: ['x86_64'],
|
150
|
-
source_architecture: 'SRPMS',
|
151
|
-
package_format: 'rpm',
|
152
|
-
source_package_formats: ['src.rpm'],
|
153
|
-
signature_format: 'v4',
|
154
|
-
repo: true,
|
155
|
-
},
|
156
|
-
'f27' => {
|
157
|
-
architectures: ['x86_64'],
|
158
|
-
source_architecture: 'SRPMS',
|
159
|
-
package_format: 'rpm',
|
160
|
-
source_package_formats: ['src.rpm'],
|
161
|
-
signature_format: 'v4',
|
162
|
-
repo: true,
|
163
|
-
},
|
164
|
-
'f28' => {
|
165
|
-
architectures: ['x86_64'],
|
166
|
-
source_architecture: 'SRPMS',
|
167
|
-
package_format: 'rpm',
|
168
|
-
source_package_formats: ['src.rpm'],
|
169
|
-
signature_format: 'v4',
|
170
|
-
repo: true,
|
171
|
-
},
|
172
|
-
'25' => {
|
173
|
-
architectures: ['x86_64', 'i386'],
|
174
|
-
source_architecture: 'SRPMS',
|
175
|
-
package_format: 'rpm',
|
176
|
-
source_package_formats: ['src.rpm'],
|
177
|
-
signature_format: 'v4',
|
178
|
-
repo: true,
|
179
|
-
},
|
180
|
-
'26' => {
|
181
|
-
architectures: ['x86_64'],
|
182
|
-
source_architecture: 'SRPMS',
|
183
|
-
package_format: 'rpm',
|
184
|
-
source_package_formats: ['src.rpm'],
|
185
|
-
signature_format: 'v4',
|
186
|
-
repo: true,
|
187
|
-
},
|
188
|
-
'27' => {
|
189
|
-
architectures: ['x86_64'],
|
190
|
-
source_architecture: 'SRPMS',
|
191
|
-
package_format: 'rpm',
|
192
|
-
source_package_formats: ['src.rpm'],
|
193
|
-
signature_format: 'v4',
|
194
|
-
repo: true,
|
195
|
-
},
|
196
|
-
'28' => {
|
197
|
-
architectures: ['x86_64'],
|
198
|
-
source_architecture: 'SRPMS',
|
199
|
-
package_format: 'rpm',
|
200
|
-
source_package_formats: ['src.rpm'],
|
201
|
-
signature_format: 'v4',
|
202
|
-
repo: true,
|
203
|
-
},
|
204
|
-
'29' => {
|
205
|
-
architectures: ['x86_64'],
|
206
|
-
source_architecture: 'SRPMS',
|
207
|
-
package_format: 'rpm',
|
208
|
-
source_package_formats: ['src.rpm'],
|
209
|
-
signature_format: 'v4',
|
210
|
-
repo: true,
|
211
|
-
},
|
212
121
|
'30' => {
|
213
122
|
architectures: ['x86_64'],
|
214
123
|
source_architecture: 'SRPMS',
|
@@ -228,21 +137,6 @@ module Pkg
|
|
228
137
|
},
|
229
138
|
|
230
139
|
'osx' => {
|
231
|
-
'10.10' => {
|
232
|
-
architectures: ['x86_64'],
|
233
|
-
package_format: 'dmg',
|
234
|
-
repo: false,
|
235
|
-
},
|
236
|
-
'10.11' => {
|
237
|
-
architectures: ['x86_64'],
|
238
|
-
package_format: 'dmg',
|
239
|
-
repo: false,
|
240
|
-
},
|
241
|
-
'10.12' => {
|
242
|
-
architectures: ['x86_64'],
|
243
|
-
package_format: 'dmg',
|
244
|
-
repo: false,
|
245
|
-
},
|
246
140
|
'10.13' => {
|
247
141
|
architectures: ['x86_64'],
|
248
142
|
package_format: 'dmg',
|
@@ -273,7 +167,7 @@ module Pkg
|
|
273
167
|
|
274
168
|
'sles' => {
|
275
169
|
'11' => {
|
276
|
-
architectures: ['x86_64', 'i386'
|
170
|
+
architectures: ['x86_64', 'i386'],
|
277
171
|
source_architecture: 'SRPMS',
|
278
172
|
package_format: 'rpm',
|
279
173
|
source_package_formats: ['src.rpm'],
|
@@ -281,7 +175,7 @@ module Pkg
|
|
281
175
|
repo: true,
|
282
176
|
},
|
283
177
|
'12' => {
|
284
|
-
architectures: ['x86_64', '
|
178
|
+
architectures: ['x86_64', 'ppc64le'],
|
285
179
|
source_architecture: 'SRPMS',
|
286
180
|
package_format: 'rpm',
|
287
181
|
source_package_formats: ['src.rpm'],
|
data/lib/packaging/util/ship.rb
CHANGED
@@ -106,22 +106,11 @@ module Pkg::Util::Ship
|
|
106
106
|
|
107
107
|
def ship_rpms(local_staging_directory, remote_path, opts = {})
|
108
108
|
ship_pkgs(["#{local_staging_directory}/**/*.rpm", "#{local_staging_directory}/**/*.srpm"], Pkg::Config.yum_staging_server, remote_path, opts)
|
109
|
-
|
110
|
-
create_rolling_repo_link(Pkg::Platforms.generic_platform_tag('el'), Pkg::Config.yum_staging_server, remote_path, opts[:nonfinal])
|
111
109
|
end
|
112
110
|
|
113
111
|
def ship_debs(local_staging_directory, remote_path, opts = {})
|
114
112
|
ship_pkgs(["#{local_staging_directory}/**/*.debian.tar.gz", "#{local_staging_directory}/**/*.orig.tar.gz" "#{local_staging_directory}/**/*.dsc", "#{local_staging_directory}/**/*.deb", "#{local_staging_directory}/**/*.changes"], Pkg::Config.apt_signing_server, remote_path, opts)
|
115
113
|
|
116
|
-
# We need to iterate through all the supported platforms here because of
|
117
|
-
# how deb repos are set up. Each codename will have its own link from the
|
118
|
-
# current versioned repo (e.g. puppet5) to the rolling repo. The one thing
|
119
|
-
# we don't care about is architecture, so we just grab the first supported
|
120
|
-
# architecture for the code name we're working with at the moment. [written
|
121
|
-
# by Melissa, copied by Molly]
|
122
|
-
Pkg::Platforms.codenames.each do |codename|
|
123
|
-
create_rolling_repo_link(Pkg::Platforms.codename_to_tags(codename)[0], Pkg::Config.apt_signing_server, remote_path, opts[:nonfinal])
|
124
|
-
end
|
125
114
|
end
|
126
115
|
|
127
116
|
def ship_svr4(local_staging_directory, remote_path, opts = {})
|
@@ -135,8 +124,6 @@ module Pkg::Util::Ship
|
|
135
124
|
def ship_dmg(local_staging_directory, remote_path, opts = {})
|
136
125
|
packages_have_shipped = ship_pkgs(["#{local_staging_directory}/**/*.dmg"], Pkg::Config.dmg_staging_server, remote_path, opts)
|
137
126
|
|
138
|
-
create_rolling_repo_link(Pkg::Platforms.generic_platform_tag('osx'), Pkg::Config.dmg_staging_server, remote_path, opts[:nonfinal])
|
139
|
-
|
140
127
|
if packages_have_shipped
|
141
128
|
Pkg::Platforms.platform_tags_for_package_format('dmg').each do |platform_tag|
|
142
129
|
# Create the latest symlink for the current supported repo
|
@@ -147,14 +134,11 @@ module Pkg::Util::Ship
|
|
147
134
|
|
148
135
|
def ship_swix(local_staging_directory, remote_path, opts = {})
|
149
136
|
ship_pkgs(["#{local_staging_directory}/**/*.swix"], Pkg::Config.swix_staging_server, remote_path, opts)
|
150
|
-
|
151
|
-
create_rolling_repo_link(Pkg::Platforms.generic_platform_tag('eos'), Pkg::Config.swix_staging_server, remote_path, opts[:nonfinal])
|
152
137
|
end
|
153
138
|
|
154
139
|
def ship_msi(local_staging_directory, remote_path, opts = {})
|
155
140
|
packages_have_shipped = ship_pkgs(["#{local_staging_directory}/**/*.msi"], Pkg::Config.msi_staging_server, remote_path, opts)
|
156
141
|
|
157
|
-
create_rolling_repo_link(Pkg::Platforms.generic_platform_tag('windows'), Pkg::Config.msi_staging_server, remote_path, opts[:nonfinal])
|
158
142
|
if packages_have_shipped
|
159
143
|
# Create the symlinks for the latest supported repo
|
160
144
|
Pkg::Util::Net.remote_create_latest_symlink(Pkg::Config.project, Pkg::Paths.artifacts_path(Pkg::Platforms.generic_platform_tag('windows'), remote_path, opts[:nonfinal]), 'msi', arch: 'x64')
|
@@ -205,7 +189,35 @@ module Pkg::Util::Ship
|
|
205
189
|
|
206
190
|
Pkg::Util::Net.remote_ssh_cmd(staging_server, command) unless command.nil?
|
207
191
|
rescue => e
|
208
|
-
fail "Failed to create rolling repo link for '#{platform_tag}'.\n#{e}"
|
192
|
+
fail "Failed to create rolling repo link for '#{platform_tag}'.\n#{e}\n#{e.backtrace}"
|
193
|
+
end
|
194
|
+
|
195
|
+
# create all of the rolling repo links in one step
|
196
|
+
def create_rolling_repo_links(nonfinal = false)
|
197
|
+
yum_path = Pkg::Paths.remote_repo_base(nonfinal: nonfinal, package_format: 'rpm')
|
198
|
+
dmg_path = Pkg::Paths.remote_repo_base(nonfinal: nonfinal, package_format: 'dmg')
|
199
|
+
swix_path = Pkg::Paths.remote_repo_base(nonfinal: nonfinal, package_format: 'swix')
|
200
|
+
msi_path = Pkg::Paths.remote_repo_base(nonfinal: nonfinal, package_format: 'msi')
|
201
|
+
|
202
|
+
create_rolling_repo_link(Pkg::Platforms.generic_platform_tag('el'), Pkg::Config.yum_staging_server, yum_path, nonfinal)
|
203
|
+
create_rolling_repo_link(Pkg::Platforms.generic_platform_tag('osx'), Pkg::Config.dmg_staging_server, dmg_path, nonfinal)
|
204
|
+
create_rolling_repo_link(Pkg::Platforms.generic_platform_tag('eos'), Pkg::Config.swix_staging_server, swix_path, nonfinal)
|
205
|
+
create_rolling_repo_link(Pkg::Platforms.generic_platform_tag('windows'), Pkg::Config.msi_staging_server, msi_path, nonfinal)
|
206
|
+
|
207
|
+
# We need to iterate through all the supported platforms here because of
|
208
|
+
# how deb repos are set up. Each codename will have its own link from the
|
209
|
+
# current versioned repo (e.g. puppet5) to the rolling repo. The one thing
|
210
|
+
# we don't care about is architecture, so we just grab the first supported
|
211
|
+
# architecture for the code name we're working with at the moment. [written
|
212
|
+
# by Melissa, copied by Molly]
|
213
|
+
|
214
|
+
apt_path = Pkg::Config.apt_repo_staging_path
|
215
|
+
if nonfinal
|
216
|
+
apt_path = Pkg::Config.nonfinal_apt_repo_staging_path
|
217
|
+
end
|
218
|
+
Pkg::Platforms.codenames.each do |codename|
|
219
|
+
create_rolling_repo_link(Pkg::Platforms.codename_to_tags(codename)[0], Pkg::Config.apt_signing_server, apt_path, nonfinal)
|
220
|
+
end
|
209
221
|
end
|
210
222
|
|
211
223
|
def update_release_package_symlinks(local_staging_directory, nonfinal = false)
|
@@ -215,7 +227,7 @@ module Pkg::Util::Ship
|
|
215
227
|
package_format = Pkg::Platforms.package_format_for_tag(platform_tag)
|
216
228
|
case package_format
|
217
229
|
when 'rpm'
|
218
|
-
remote_base = Pkg::Paths.artifacts_path(platform_tag, Pkg::Paths.remote_repo_base(platform_tag, nonfinal), nonfinal)
|
230
|
+
remote_base = Pkg::Paths.artifacts_path(platform_tag, Pkg::Paths.remote_repo_base(platform_tag, nonfinal: nonfinal), nonfinal)
|
219
231
|
when 'deb'
|
220
232
|
remote_base = Pkg::Paths.apt_package_base_path(platform_tag, Pkg::Paths.repo_name(nonfinal), Pkg::Config.project, nonfinal)
|
221
233
|
else
|
@@ -41,10 +41,10 @@ describe 'artifactory.rb' do
|
|
41
41
|
:repo_config => '',
|
42
42
|
:additional_artifacts => ["./eos/4/PC1/i386/puppet-agent-extras-5.3.1.34.gf65f9ef-1.eos4.i386.swix"],
|
43
43
|
},
|
44
|
-
'osx-10.
|
45
|
-
:artifact => "./apple/10.
|
44
|
+
'osx-10.15-x86_64' => {
|
45
|
+
:artifact => "./apple/10.15/PC1/x86_64/puppet-agent-5.3.1.34.gf65f9ef-1.osx10.15.dmg",
|
46
46
|
:repo_config => '',
|
47
|
-
:additional_artifacts => ["./apple/10.
|
47
|
+
:additional_artifacts => ["./apple/10.15/PC1/x86_64/puppet-agent-extras-5.3.1.34.gf65f9ef-1.osx10.15.dmg"],
|
48
48
|
},
|
49
49
|
'solaris-10-sparc' => {
|
50
50
|
:artifact => "./solaris/10/PC1/puppet-agent-5.3.1.34.gf65f9ef-1.sparc.pkg.gz",
|
@@ -77,7 +77,7 @@ describe 'artifactory.rb' do
|
|
77
77
|
:package_name => 'path/to/a/buster/package/puppetdb_5.3.1.34.gf65f9ef-1buster_all.deb',
|
78
78
|
:all_package_names => ['puppetdb_5.3.1.34.gf65f9ef-1buster_all.deb', 'puppetdb-termini_5.3.1.34.gf65f9ef-1buster_all.deb']
|
79
79
|
},
|
80
|
-
'windows-2012-x86' => {
|
80
|
+
'windows-2012-x86' => {
|
81
81
|
:toplevel_repo => 'generic',
|
82
82
|
:repo_subdirectories => "#{default_repo_name}/#{project}/#{project_version}/windows-x86",
|
83
83
|
:package_name => 'path/to/a/windows/package/puppet-agent-5.3.1.34-x86.msi',
|
@@ -95,11 +95,11 @@ describe 'artifactory.rb' do
|
|
95
95
|
:package_name => 'path/to/an/eos/4/package/puppet-agent-5.3.1.34.gf65f9ef-1.eos4.i386.swix',
|
96
96
|
:all_package_names => ['puppet-agent-5.3.1.34.gf65f9ef-1.eos4.i386.swix', 'puppet-agent-extras-5.3.1.34.gf65f9ef-1.eos4.i386.swix']
|
97
97
|
},
|
98
|
-
'osx-10.
|
98
|
+
'osx-10.15-x86_64' => {
|
99
99
|
:toplevel_repo => 'generic',
|
100
|
-
:repo_subdirectories => "#{default_repo_name}/#{project}/#{project_version}/osx-10.
|
101
|
-
:package_name => 'path/to/an/osx/10.
|
102
|
-
:all_package_names => ['puppet-agent-5.3.1.34.gf65f9ef-1.osx10.
|
100
|
+
:repo_subdirectories => "#{default_repo_name}/#{project}/#{project_version}/osx-10.15-x86_64",
|
101
|
+
:package_name => 'path/to/an/osx/10.15/package/puppet-agent-5.3.1.34.gf65f9ef-1.osx10.15.dmg',
|
102
|
+
:all_package_names => ['puppet-agent-5.3.1.34.gf65f9ef-1.osx10.15.dmg', 'puppet-agent-extras-5.3.1.34.gf65f9ef-1.osx10.15.dmg']
|
103
103
|
},
|
104
104
|
'solaris-10-sparc' => {
|
105
105
|
:toplevel_repo => 'generic',
|
@@ -125,7 +125,6 @@ describe 'artifactory.rb' do
|
|
125
125
|
expect(artifact.location_for(platform_tag)).to match_array([
|
126
126
|
platform_tag_data[:toplevel_repo],
|
127
127
|
platform_tag_data[:repo_subdirectories],
|
128
|
-
File.join('pool', platform_tag_data[:repo_subdirectories])
|
129
128
|
])
|
130
129
|
end
|
131
130
|
else
|
@@ -133,7 +132,6 @@ describe 'artifactory.rb' do
|
|
133
132
|
expect(artifact.location_for(platform_tag)).to match_array([
|
134
133
|
platform_tag_data[:toplevel_repo],
|
135
134
|
platform_tag_data[:repo_subdirectories],
|
136
|
-
platform_tag_data[:repo_subdirectories]
|
137
135
|
])
|
138
136
|
end
|
139
137
|
end
|
@@ -142,7 +140,6 @@ describe 'artifactory.rb' do
|
|
142
140
|
expect(artifact.location_for('generic')).to match_array([
|
143
141
|
'generic',
|
144
142
|
File.join(default_repo_name, project, project_version),
|
145
|
-
File.join(default_repo_name, project, project_version)
|
146
143
|
])
|
147
144
|
end
|
148
145
|
end
|
@@ -203,22 +203,20 @@ describe "Pkg::Config" do
|
|
203
203
|
describe "#platform_data" do
|
204
204
|
platform_tags = [
|
205
205
|
'eos-4-i386',
|
206
|
-
'osx-10.
|
206
|
+
'osx-10.15-x86_64',
|
207
207
|
'cisco-wrlinux-7-x86_64',
|
208
208
|
'ubuntu-16.04-i386',
|
209
|
-
'
|
210
|
-
'el-6-s390x',
|
209
|
+
'el-6-x86_64',
|
211
210
|
'el-7-ppc64le',
|
212
211
|
'sles-12-x86_64',
|
213
212
|
]
|
214
213
|
|
215
214
|
artifacts = \
|
216
215
|
"./artifacts/eos/4/PC1/i386/puppet-agent-5.3.2-1.eos4.i386.swix\n" \
|
217
|
-
"./artifacts/apple/10.
|
216
|
+
"./artifacts/apple/10.15/PC1/x86_64/puppet-agent-5.3.2.658.gc79ef9a-1.osx10.15.dmg\n" \
|
218
217
|
"./artifacts/cisco-wrlinux/7/PC1/x86_64/puppet-agent-5.3.2-1.cisco_wrlinux7.x86_64.rpm\n" \
|
219
218
|
"./artifacts/deb/xenial/PC1/puppet-agent_5.3.2-1xenial_i386.deb\n" \
|
220
|
-
"./artifacts/
|
221
|
-
"./artifacts/el/6/PC1/s390x/puppet-agent-5.3.2.658.gc79ef9a-1.el6.s390x.rpm\n" \
|
219
|
+
"./artifacts/el/6/PC1/x86_64/puppet-agent-5.3.2.658.gc79ef9a-1.el6.x86_64.rpm\n" \
|
222
220
|
"./artifacts/el/7/PC1/ppc64le/puppet-agent-5.3.2-1.el7.ppc64le.rpm\n" \
|
223
221
|
"./artifacts/sles/12/PC1/x86_64/puppet-agent-5.3.2-1.sles12.x86_64.rpm"
|
224
222
|
|
@@ -226,7 +224,7 @@ describe "Pkg::Config" do
|
|
226
224
|
"./artifacts/aix/6.1/PC1/ppc/puppet-agent-5.3.2-1.aix6.1.ppc.rpm"
|
227
225
|
|
228
226
|
fedora_artifacts = \
|
229
|
-
"./artifacts/fedora/
|
227
|
+
"./artifacts/fedora/31/PC1/x86_64/puppet-agent-5.3.2-1.fc31.x86_64.rpm"
|
230
228
|
|
231
229
|
windows_artifacts = \
|
232
230
|
"./artifacts/windows/puppet-agent-x64.msi\n" \
|
@@ -283,8 +281,8 @@ describe "Pkg::Config" do
|
|
283
281
|
it "should not use 'f' in fedora platform tags" do
|
284
282
|
allow(Pkg::Util::Net).to receive(:remote_ssh_cmd).and_return(fedora_artifacts, nil)
|
285
283
|
data = Pkg::Config.platform_data
|
286
|
-
expect(data).to include('fedora-
|
287
|
-
expect(data).not_to include('fedora-
|
284
|
+
expect(data).to include('fedora-31-x86_64')
|
285
|
+
expect(data).not_to include('fedora-f31-x86_64')
|
288
286
|
end
|
289
287
|
|
290
288
|
it "should collect packages whose extname differ from package_format" do
|
@@ -25,17 +25,15 @@ describe 'Pkg::Paths' do
|
|
25
25
|
'pkg/ubuntu-16.04-amd64/puppet-agent_4.99.0-1xenial_amd64.deb' => 'ubuntu-16.04-amd64',
|
26
26
|
'pkg/windows-x64/puppet-agent-4.99.0-x64.msi' => 'windows-2012-x64',
|
27
27
|
'artifacts/el/6/products/x86_64/pe-r10k-2.5.4.3-1.el6.x86_64.rpm' => 'el-6-x86_64',
|
28
|
-
'pkg/deb/trusty/pe-r10k_2.5.4.3-1trusty_amd64.deb' => 'ubuntu-14.04-amd64',
|
29
28
|
'pkg/pe/rpm/el-6-i386/pe-puppetserver-2017.3.0.3-1.el6.noarch.rpm' => 'el-6-i386',
|
30
29
|
'pkg/deb/trusty/pe-r10k_2.5.4.3-1trusty_amd64.deb' => 'ubuntu-14.04-amd64',
|
31
30
|
'pkg/pe/deb/xenial/pe-puppetserver_2017.3.0.3-1puppet1_all.deb' => 'ubuntu-16.04-amd64',
|
32
31
|
'pkg/pe/deb/xenial/super-trusty-package_1.0.0-1puppet1_all.deb' => 'ubuntu-16.04-amd64',
|
33
|
-
'artifacts/deb/
|
32
|
+
'artifacts/deb/stretch/PC1/puppetdb_4.3.1-1puppetlabs1_all.deb' => 'debian-9-amd64',
|
34
33
|
'pkg/el/7/PC1/x86_64/puppetdb-4.3.1-1.el7.noarch.rpm' => 'el-7-x86_64',
|
35
|
-
'pkg/apple/10.
|
36
|
-
'artifacts/mac/10.
|
34
|
+
'pkg/apple/10.14/PC1/x86_64/puppet-agent-1.9.0-1.osx10.14.dmg' => 'osx-10.14-x86_64',
|
35
|
+
'artifacts/mac/10.15/PC1/x86_64/puppet-agent-1.9.0-1.osx10.15.dmg' => 'osx-10.15-x86_64',
|
37
36
|
'artifacts/eos/4/PC1/i386/puppet-agent-1.9.0-1.eos4.i386.swix' => 'eos-4-i386',
|
38
|
-
'pkg/deb/cumulus/puppet5/puppet-agent_1.4.1.2904.g8023dd1-1cumulus_amd64.deb' => 'cumulus-2.2-amd64',
|
39
37
|
'pkg/windows/puppet-agent-1.9.0-x86.msi' => 'windows-2012-x86',
|
40
38
|
'artifacts/ubuntu-16.04-i386/puppetserver_5.0.1-0.1SNAPSHOT.2017.07.27T2346puppetlabs1.debian.tar.gz' => 'ubuntu-16.04-source',
|
41
39
|
'http://saturn.puppetlabs.net/deb_repos/1234abcd/repos/apt/xenial' => 'ubuntu-16.04-amd64',
|
@@ -97,8 +95,8 @@ describe 'Pkg::Paths' do
|
|
97
95
|
expect(Pkg::Paths.artifacts_path('el-7-x86_64')).to eq('artifacts/puppet5/el/7/x86_64')
|
98
96
|
end
|
99
97
|
|
100
|
-
it 'should be correct for
|
101
|
-
expect(Pkg::Paths.artifacts_path('ubuntu-
|
98
|
+
it 'should be correct for bionic' do
|
99
|
+
expect(Pkg::Paths.artifacts_path('ubuntu-18.04-amd64')).to eq('artifacts/bionic/puppet5')
|
102
100
|
end
|
103
101
|
|
104
102
|
it 'should be correct for solaris 11' do
|
@@ -106,7 +104,7 @@ describe 'Pkg::Paths' do
|
|
106
104
|
end
|
107
105
|
|
108
106
|
it 'should be correct for osx' do
|
109
|
-
expect(Pkg::Paths.artifacts_path('osx-10.
|
107
|
+
expect(Pkg::Paths.artifacts_path('osx-10.15-x86_64')).to eq('artifacts/mac/puppet5/10.15/x86_64')
|
110
108
|
end
|
111
109
|
|
112
110
|
it 'should be correct for windows' do
|
@@ -211,36 +209,11 @@ describe 'Pkg::Paths' do
|
|
211
209
|
end
|
212
210
|
end
|
213
211
|
|
214
|
-
describe '#is_legacy_repo?' do
|
215
|
-
it 'returns true for empty strings' do
|
216
|
-
expect(Pkg::Paths.is_legacy_repo?('')).to be_true
|
217
|
-
end
|
218
|
-
|
219
|
-
it 'returns true for PC1' do
|
220
|
-
expect(Pkg::Paths.is_legacy_repo?('PC1')).to be_true
|
221
|
-
end
|
222
|
-
|
223
|
-
it 'returns true for foopuppetbar' do
|
224
|
-
expect(Pkg::Paths.is_legacy_repo?('foopuppetbar')).to be_true
|
225
|
-
end
|
226
|
-
|
227
|
-
it 'returns false for puppet5' do
|
228
|
-
expect(Pkg::Paths.is_legacy_repo?('puppet5')).to be_false
|
229
|
-
end
|
230
|
-
|
231
|
-
it 'returns false for puppet8-nightly' do
|
232
|
-
expect(Pkg::Paths.is_legacy_repo?('puppet8-nightly')).to be_false
|
233
|
-
end
|
234
|
-
|
235
|
-
it 'returns false for puppet' do
|
236
|
-
expect(Pkg::Paths.is_legacy_repo?('puppet')).to be_false
|
237
|
-
end
|
238
|
-
end
|
239
|
-
|
240
212
|
describe '#remote_repo_base' do
|
241
213
|
before :each do
|
242
214
|
allow(Pkg::Config).to receive(:yum_repo_path).and_return('foo')
|
243
215
|
allow(Pkg::Config).to receive(:apt_repo_path).and_return('bar')
|
216
|
+
allow(Pkg::Config).to receive(:dmg_path).and_return('/opt/downloads/mac')
|
244
217
|
allow(Pkg::Config).to receive(:nonfinal_yum_repo_path).and_return('foo-nightly')
|
245
218
|
allow(Pkg::Config).to receive(:nonfinal_apt_repo_path).and_return('bar-nightly')
|
246
219
|
end
|
@@ -251,13 +224,21 @@ describe 'Pkg::Paths' do
|
|
251
224
|
expect(Pkg::Paths.remote_repo_base('ubuntu-18.04-amd64')).to eq('bar')
|
252
225
|
end
|
253
226
|
it 'returns nonfinal_yum_repo_path for nonfinal rpms' do
|
254
|
-
expect(Pkg::Paths.remote_repo_base('fedora-
|
227
|
+
expect(Pkg::Paths.remote_repo_base('fedora-31-x86_64', nonfinal: true)).to eq('foo-nightly')
|
255
228
|
end
|
256
229
|
it 'returns nonfinal_apt_repo_path for nonfinal debs' do
|
257
|
-
expect(Pkg::Paths.remote_repo_base('debian-9-amd64', true)).to eq('bar-nightly')
|
230
|
+
expect(Pkg::Paths.remote_repo_base('debian-9-amd64', nonfinal: true)).to eq('bar-nightly')
|
258
231
|
end
|
232
|
+
it 'fails if neither tag nor package_format is provided' do
|
233
|
+
expect { Pkg::Paths.remote_repo_base }.to raise_error(/Pkg::Paths.remote_repo_base must have/)
|
234
|
+
end
|
235
|
+
|
236
|
+
it 'returns /opt/downloads if the path is /opt/downloads/<something>' do
|
237
|
+
expect(Pkg::Paths.remote_repo_base(package_format: 'dmg')).to eq('/opt/downloads')
|
238
|
+
end
|
239
|
+
|
259
240
|
it 'fails for all other package formats' do
|
260
|
-
expect { Pkg::Paths.remote_repo_base('
|
241
|
+
expect { Pkg::Paths.remote_repo_base('solaris-11-i386') }.to raise_error(/Can't determine remote repo base path/)
|
261
242
|
end
|
262
243
|
end
|
263
244
|
|
@@ -305,7 +286,7 @@ describe 'Pkg::Paths' do
|
|
305
286
|
expect(Pkg::Paths.release_package_link_path('debian-9-i386', true)).to eq("#{nonfinal_apt_repo_path}/#{nonfinal_repo_name}-release-stretch.deb")
|
306
287
|
end
|
307
288
|
it 'returns nil for package formats that do not have release packages' do
|
308
|
-
expect(Pkg::Paths.release_package_link_path('osx-10.
|
289
|
+
expect(Pkg::Paths.release_package_link_path('osx-10.15-x86_64')).to eq(nil)
|
309
290
|
expect(Pkg::Paths.release_package_link_path('windows-2012-x86')).to eq(nil)
|
310
291
|
end
|
311
292
|
end
|