simp-rake-helpers 5.8.2 → 5.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/simp/rake/build/build.rb +7 -6
- data/lib/simp/rake/build/tar.rb +10 -3
- data/lib/simp/rake/helpers/version.rb +1 -1
- data/lib/simp/yum.rb +33 -8
- data/spec/acceptance/20_pkg_rpm_upgrade_spec.rb +0 -3
- data/spec/acceptance/nodesets/default.yml +5 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54d1377b43fb4f767b3446a80fcbb490a073426d699b927a0b1a65d4a8290f35
|
4
|
+
data.tar.gz: 0f87a6cdfbaa27f9f1743474f41dca4a0bfccf661277820386d72265278200b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64c1768cd854505513de05cbacc326096ef733965b0897ed874c16ade248c5ca7252cf13026d49efa86c9d31cfb074c700a87d74627313f94a9dd9171bbc7531
|
7
|
+
data.tar.gz: 393d0d037e9a88ab10f02f2159f002d35fcc5bde21497e0ce3283e7495ab68bf4b138fd50c5c1814ec2f78aca6115147c6cf37b29c9228def09fbe511ac85338
|
data/CHANGELOG.md
CHANGED
@@ -157,15 +157,16 @@ module Simp::Rake::Build
|
|
157
157
|
source = yum_helper.get_source(rpm) unless source
|
158
158
|
|
159
159
|
Dir.chdir('packages') do
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
160
|
+
unless File.exist?(rpm)
|
161
|
+
puts("Downloading: #{rpm}")
|
162
|
+
downloaded_rpm = yum_helper.download(source)
|
163
|
+
|
164
|
+
raise(SIMPBuildException,"#{rpm} could not be downloaded") unless downloaded_rpm
|
164
165
|
|
165
166
|
begin
|
166
|
-
validate_rpm(
|
167
|
+
validate_rpm(downloaded_rpm)
|
167
168
|
rescue SIMPBuildException
|
168
|
-
rm(
|
169
|
+
rm(rpm) if File.exist?(rpm)
|
169
170
|
raise(SIMPBuildException,"#{rpm} could not be downloaded")
|
170
171
|
end
|
171
172
|
end
|
data/lib/simp/rake/build/tar.rb
CHANGED
@@ -51,13 +51,20 @@ module Simp::Rake::Build
|
|
51
51
|
'rubygem-simp-cli',
|
52
52
|
'simp',
|
53
53
|
'simp-gpgkeys',
|
54
|
-
'simp-rsync-skeleton',
|
55
|
-
'simp-environment-skeleton',
|
56
|
-
'simp-environment-selinux-policy',
|
57
54
|
'simp-utils'
|
58
55
|
]
|
59
56
|
}
|
60
57
|
|
58
|
+
simp_version = get_simp_version
|
59
|
+
|
60
|
+
if Gem::Version.new(simp_version) < Gem::Version.new('6.4.0')
|
61
|
+
required_rpms['noarch'] << 'simp-rsync'
|
62
|
+
else
|
63
|
+
required_rpms['noarch'] << 'simp-rsync-skeleton'
|
64
|
+
required_rpms['noarch'] << 'simp-environment-skeleton'
|
65
|
+
required_rpms['noarch'] << 'simp-environment-selinux-policy'
|
66
|
+
end
|
67
|
+
|
61
68
|
rpm_dir = File.join(@build_dir,'SIMP','RPMS')
|
62
69
|
fail("Could not find directory '#{rpm_dir}'") unless File.directory?(rpm_dir)
|
63
70
|
|
data/lib/simp/yum.rb
CHANGED
@@ -140,11 +140,17 @@ module Simp
|
|
140
140
|
end
|
141
141
|
|
142
142
|
def get_sources(rpm)
|
143
|
-
|
143
|
+
Dir.mktmpdir do |dir|
|
144
|
+
output = %x(#{@@yumdownloader} --urls #{File.basename(rpm,'.rpm')} 2>/dev/null).lines
|
145
|
+
sources = output.grep(%r(\.rpm$))
|
144
146
|
|
145
|
-
|
147
|
+
unless (output.grep(/Error/).empty? || sources.empty?)
|
148
|
+
err_msg = "\n-- YUMDOWNLOADER ERROR --\n" + output.join("\n")
|
149
|
+
raise(Error, "No sources found for '#{rpm}'" + err_msg)
|
150
|
+
end
|
146
151
|
|
147
|
-
|
152
|
+
return sources
|
153
|
+
end
|
148
154
|
end
|
149
155
|
|
150
156
|
def get_source(rpm, arch=nil)
|
@@ -163,6 +169,10 @@ module Simp
|
|
163
169
|
end
|
164
170
|
|
165
171
|
def download(rpm, opts={:target_dir => nil})
|
172
|
+
rpm.strip!
|
173
|
+
|
174
|
+
downloaded_rpm_name = nil
|
175
|
+
|
166
176
|
target_dir = Dir.pwd
|
167
177
|
|
168
178
|
if opts[:target_dir]
|
@@ -176,9 +186,9 @@ module Simp
|
|
176
186
|
# In case someone passed a path
|
177
187
|
rpm_name = rpm.split(File::SEPARATOR).last
|
178
188
|
|
179
|
-
|
180
|
-
|
181
|
-
|
189
|
+
err_msg = %x(#{@@yumdownloader} #{File.basename(rpm_name, '.rpm')} 2>/dev/null)
|
190
|
+
|
191
|
+
downloaded_rpm_name = rpm_name
|
182
192
|
else
|
183
193
|
# If passed a URL, curl it and fall back to yumdownloader
|
184
194
|
rpm_name = rpm.split('/').last
|
@@ -190,12 +200,25 @@ module Simp
|
|
190
200
|
# Fall back on yumdownloader
|
191
201
|
FileUtils.rm_f(rpm_name)
|
192
202
|
|
193
|
-
%x(#{@@yumdownloader} #{File.basename(rpm_name, '.rpm')} 2
|
203
|
+
err_msg = %x(#{@@yumdownloader} #{File.basename(rpm_name, '.rpm')} 2>/dev/null)
|
194
204
|
end
|
205
|
+
|
206
|
+
# We might get a filename that doesn't make sense so we need to
|
207
|
+
# move the file appropriately
|
208
|
+
rpm_info = Simp::RPM.new(rpm_name)
|
209
|
+
|
210
|
+
unless File.exist?(rpm_info.rpm_name)
|
211
|
+
FileUtils.mv(rpm_name, rpm_info.rpm_name)
|
212
|
+
end
|
213
|
+
|
214
|
+
downloaded_rpm_name = rpm_info.rpm_name
|
195
215
|
end
|
196
216
|
|
197
217
|
rpms = Dir.glob('*.rpm')
|
198
|
-
|
218
|
+
|
219
|
+
err_msg = ''
|
220
|
+
err_msg = "\n-- ERROR MESSAGE --\n" + err_msg if err_msg
|
221
|
+
raise(Error, "Could not find any remote RPMs for #{rpm}" + err_msg) if rpms.empty?
|
199
222
|
|
200
223
|
# Copy over all of the RPMs
|
201
224
|
rpms.each do |new_rpm|
|
@@ -204,6 +227,8 @@ module Simp
|
|
204
227
|
end
|
205
228
|
end
|
206
229
|
end
|
230
|
+
|
231
|
+
return downloaded_rpm_name
|
207
232
|
end
|
208
233
|
end
|
209
234
|
end
|
@@ -91,9 +91,6 @@ describe 'rake pkg:rpm + component upgrade scenarios' do
|
|
91
91
|
copy_host_files_into_build_user_homedir(hosts)
|
92
92
|
|
93
93
|
comment 'ensure the Puppet AIO is installed'
|
94
|
-
#FIXME Should install Puppet 5
|
95
|
-
ENV['PUPPET_INSTALL_TYPE'] ||= 'agent'
|
96
|
-
ENV['PUPPET_INSTALL_VERSION'] ||= '1.10.6'
|
97
94
|
run_puppet_install_helper_on(hosts)
|
98
95
|
|
99
96
|
comment 'configure puppet agent to look like a Puppet server for simp_rpm_helper'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simp-rake-helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.8.
|
4
|
+
version: 5.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Tessmer
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-05-
|
12
|
+
date: 2019-05-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: simp-beaker-helpers
|
@@ -568,7 +568,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
568
568
|
- !ruby/object:Gem::Version
|
569
569
|
version: '0'
|
570
570
|
requirements: []
|
571
|
-
rubygems_version: 3.0.
|
571
|
+
rubygems_version: 3.0.3
|
572
572
|
signing_key:
|
573
573
|
specification_version: 4
|
574
574
|
summary: SIMP rake helpers
|