packaging 0.99.55 → 0.99.56
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/packaging/config.rb +72 -66
- metadata +18 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91478585428801cdfc12e3da5f0dcb54b748d0f1ca3fc21517287b8ffddc53d1
|
4
|
+
data.tar.gz: ef8871c674e926d599edcee2be2d58ada0d0bad919f33a078e163f40c65d3e2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d529dea7fac73e55a9f634feb3cde54d082de316bcc30c886ad9471484432bff5a1e410984d916946e26124a7903f86e45833461b8b71770dc3e702c96e0096
|
7
|
+
data.tar.gz: c3b9ddbd1a08552ec7488091b55429cbc5e74a2029a2839bcb427bcb7b4930e58b469641b715b68134af73dc0d96827cb999f4451c67ca5887fac3dd8698c4c5
|
data/lib/packaging/config.rb
CHANGED
@@ -73,79 +73,85 @@ module Pkg
|
|
73
73
|
# This is to be consumed by beaker and later replaced with our metadata service.
|
74
74
|
#
|
75
75
|
def platform_data
|
76
|
-
if
|
77
|
-
|
78
|
-
|
79
|
-
artifacts, _ = Pkg::Util::Net.remote_ssh_cmd(self.builds_server, cmd, true)
|
80
|
-
artifacts = artifacts.split("\n")
|
81
|
-
data = {}
|
82
|
-
artifacts.each do |artifact|
|
83
|
-
# We need to preserve the original tag to make sure we look for
|
84
|
-
# fedora repo configs in the 1.10.x branch of puppet-agent in
|
85
|
-
# the correct place. For 5.x and 6.x release streams the f prefix
|
86
|
-
# has been removed and so tag will equal original_tag
|
87
|
-
original_tag = Pkg::Paths.tag_from_artifact_path(artifact)
|
88
|
-
|
89
|
-
# Remove the f-prefix from the fedora platform tag keys so that
|
90
|
-
# beaker can rely on consistent keys once we rip out the f for good
|
91
|
-
tag = original_tag.sub(/fedora-f/, 'fedora-')
|
92
|
-
|
93
|
-
data[tag] ||= {}
|
94
|
-
|
95
|
-
platform, version, arch = Pkg::Platforms.parse_platform_tag(tag)
|
96
|
-
package_format = Pkg::Platforms.get_attribute(tag, :package_format)
|
97
|
-
|
98
|
-
# Skip this if it's an unversioned MSI. We create these to help
|
99
|
-
# beaker install the msi without having to know any version
|
100
|
-
# information, but we should report the versioned artifact in
|
101
|
-
# platform_data
|
102
|
-
next if platform =~ /^windows.*$/ && File.basename(artifact) == "#{self.project}-#{arch}.#{package_format}"
|
103
|
-
|
104
|
-
# Sometimes we have source or debug packages. We don't want to save
|
105
|
-
# these paths in favor of the artifact paths.
|
106
|
-
if platform == 'solaris'
|
107
|
-
next if version == '10' && File.extname(artifact) != '.gz'
|
108
|
-
next if version == '11' && File.extname(artifact) != '.p5p'
|
109
|
-
else
|
110
|
-
next if File.extname(artifact) != ".#{package_format}"
|
111
|
-
end
|
76
|
+
# Return nil if something is not right..
|
77
|
+
return nil unless self.project && self.ref &&
|
78
|
+
Pkg::Util::Net.check_host_ssh([self.builds_server]).empty?
|
112
79
|
|
113
|
-
|
114
|
-
|
80
|
+
dir = "/opt/jenkins-builds/#{self.project}/#{self.ref}"
|
81
|
+
cmd = "if [ -s \"#{dir}/artifacts\" ]; then cd #{dir};"\
|
82
|
+
"find ./artifacts/ -mindepth 2 -type f; fi"
|
83
|
+
artifacts, _ = Pkg::Util::Net.remote_ssh_cmd(self.builds_server, cmd, true)
|
115
84
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
85
|
+
artifacts = artifacts.split("\n")
|
86
|
+
data = {}
|
87
|
+
artifacts.each do |artifact|
|
88
|
+
# We need to preserve the original tag to make sure we look for
|
89
|
+
# fedora repo configs in the 1.10.x branch of puppet-agent in
|
90
|
+
# the correct place. For 5.x and 6.x release streams the f prefix
|
91
|
+
# has been removed and so tag will equal original_tag
|
92
|
+
original_tag = Pkg::Paths.tag_from_artifact_path(artifact)
|
93
|
+
|
94
|
+
# Remove the f-prefix from the fedora platform tag keys so that
|
95
|
+
# beaker can rely on consistent keys once we rip out the f for good
|
96
|
+
tag = original_tag.sub(/fedora-f/, 'fedora-')
|
97
|
+
|
98
|
+
data[tag] ||= {}
|
99
|
+
|
100
|
+
platform, version, arch = Pkg::Platforms.parse_platform_tag(tag)
|
101
|
+
package_format = Pkg::Platforms.get_attribute(tag, :package_format)
|
102
|
+
|
103
|
+
# Skip this if it's an unversioned MSI. We create these to help
|
104
|
+
# beaker install the msi without having to know any version
|
105
|
+
# information, but we should report the versioned artifact in
|
106
|
+
# platform_data
|
107
|
+
next if platform =~ /^windows.*$/ &&
|
108
|
+
File.basename(artifact) == "#{self.project}-#{arch}.#{package_format}"
|
109
|
+
|
110
|
+
# Sometimes we have source or debug packages. We don't want to save
|
111
|
+
# these paths in favor of the artifact paths.
|
112
|
+
if platform == 'solaris'
|
113
|
+
next if version == '10' && File.extname(artifact) != '.gz'
|
114
|
+
next if version == '11' && File.extname(artifact) != '.p5p'
|
115
|
+
else
|
116
|
+
next if File.extname(artifact) != ".#{package_format}"
|
117
|
+
end
|
120
118
|
|
121
|
-
|
122
|
-
|
123
|
-
repo_config = "../repo_configs/deb/pl-#{self.project}-#{self.ref}-#{Pkg::Platforms.get_attribute(tag, :codename)}.list"
|
124
|
-
when 'rpm'
|
125
|
-
# Using original_tag here to not break legacy fedora repo targets
|
126
|
-
repo_config = "../repo_configs/rpm/pl-#{self.project}-#{self.ref}-#{original_tag}.repo" unless tag.include? 'aix'
|
127
|
-
when 'swix', 'svr4', 'ips', 'dmg', 'msi'
|
128
|
-
# No repo_configs for these platforms, so do nothing.
|
129
|
-
else
|
130
|
-
fail "Not sure what to do with packages with a package format of '#{package_format}' - maybe update PLATFORM_INFO?"
|
131
|
-
end
|
119
|
+
# Don't want to include debian debug packages
|
120
|
+
next if /-dbgsym/.match(File.basename(artifact))
|
132
121
|
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
122
|
+
if /#{self.project}-[a-z]+/.match(File.basename(artifact))
|
123
|
+
add_additional_artifact(data, tag, artifact.sub('artifacts/', ''))
|
124
|
+
next
|
125
|
+
end
|
126
|
+
|
127
|
+
case package_format
|
128
|
+
when 'deb'
|
129
|
+
repo_config = "../repo_configs/deb/pl-#{self.project}-#{self.ref}-"\
|
130
|
+
"#{Pkg::Platforms.get_attribute(tag, :codename)}.list"
|
131
|
+
when 'rpm'
|
132
|
+
# Using original_tag here to not break legacy fedora repo targets
|
133
|
+
unless tag.include? 'aix'
|
134
|
+
repo_config = "../repo_configs/rpm/pl-#{self.project}-"\
|
135
|
+
"#{self.ref}-#{original_tag}.repo"
|
142
136
|
end
|
137
|
+
when 'swix', 'svr4', 'ips', 'dmg', 'msi'
|
138
|
+
# No repo_configs for these platforms, so do nothing.
|
139
|
+
else
|
140
|
+
fail "Error: Unknown package format: '#{package_format}'. Maybe update PLATFORM_INFO?"
|
141
|
+
end
|
142
|
+
|
143
|
+
# handle the case where there are multiple artifacts but the artifacts are not
|
144
|
+
# named based on project name (e.g. puppet-enterprise-vanagon).
|
145
|
+
# In this case, the first one will get set as the artifact, everything else
|
146
|
+
# will be in the additional artifacts
|
147
|
+
if data[tag][:artifact].nil?
|
148
|
+
data[tag][:artifact] = artifact.sub('artifacts/', '')
|
149
|
+
data[tag][:repo_config] = repo_config
|
150
|
+
else
|
151
|
+
add_additional_artifact(data, tag, artifact.sub('artifacts/', ''))
|
143
152
|
end
|
144
|
-
return data
|
145
|
-
else
|
146
|
-
warn "Skipping platform_data collection, but don't worry about it."
|
147
|
-
return nil
|
148
153
|
end
|
154
|
+
return data
|
149
155
|
end
|
150
156
|
|
151
157
|
# Add artifact to the `additional_artifacts` array in platform data.
|
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.56
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet Labs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -245,27 +245,27 @@ specification_version: 4
|
|
245
245
|
summary: Puppet Labs' packaging automation
|
246
246
|
test_files:
|
247
247
|
- spec/lib/packaging_spec.rb
|
248
|
-
- spec/lib/packaging/
|
249
|
-
- spec/lib/packaging/
|
250
|
-
- spec/lib/packaging/
|
251
|
-
- spec/lib/packaging/
|
248
|
+
- spec/lib/packaging/deb_spec.rb
|
249
|
+
- spec/lib/packaging/retrieve_spec.rb
|
250
|
+
- spec/lib/packaging/gem_spec.rb
|
251
|
+
- spec/lib/packaging/artifactory_spec.rb
|
252
|
+
- spec/lib/packaging/config_spec.rb
|
253
|
+
- spec/lib/packaging/util/gpg_spec.rb
|
254
|
+
- spec/lib/packaging/util/rake_utils_spec.rb
|
252
255
|
- spec/lib/packaging/util/misc_spec.rb
|
253
|
-
- spec/lib/packaging/util/net_spec.rb
|
254
|
-
- spec/lib/packaging/util/execution_spec.rb
|
255
|
-
- spec/lib/packaging/util/version_spec.rb
|
256
256
|
- spec/lib/packaging/util/jenkins_spec.rb
|
257
|
+
- spec/lib/packaging/util/os_spec.rb
|
258
|
+
- spec/lib/packaging/util/git_spec.rb
|
259
|
+
- spec/lib/packaging/util/ship_spec.rb
|
257
260
|
- spec/lib/packaging/util/file_spec.rb
|
258
|
-
- spec/lib/packaging/util/
|
259
|
-
- spec/lib/packaging/util/
|
260
|
-
- spec/lib/packaging/
|
261
|
+
- spec/lib/packaging/util/version_spec.rb
|
262
|
+
- spec/lib/packaging/util/git_tag_spec.rb
|
263
|
+
- spec/lib/packaging/util/execution_spec.rb
|
264
|
+
- spec/lib/packaging/util/net_spec.rb
|
261
265
|
- spec/lib/packaging/rpm/repo_spec.rb
|
262
|
-
- spec/lib/packaging/artifactory_spec.rb
|
263
266
|
- spec/lib/packaging/paths_spec.rb
|
264
|
-
- spec/lib/packaging/config_spec.rb
|
265
|
-
- spec/lib/packaging/deb/repo_spec.rb
|
266
267
|
- spec/lib/packaging/platforms_spec.rb
|
267
|
-
- spec/lib/packaging/repo_spec.rb
|
268
268
|
- spec/lib/packaging/sign_spec.rb
|
269
|
-
- spec/lib/packaging/
|
269
|
+
- spec/lib/packaging/repo_spec.rb
|
270
270
|
- spec/lib/packaging/tar_spec.rb
|
271
|
-
- spec/lib/packaging/
|
271
|
+
- spec/lib/packaging/deb/repo_spec.rb
|