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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 861762a4c3b19940cac28b557ddb67eb274cd7a76883ba0f821f875fd3695703
4
- data.tar.gz: 3acfca7603041d856b19aa3ac1b59fb1de2627269fc5ff4d6f875b7f6f3de90e
3
+ metadata.gz: 54d1377b43fb4f767b3446a80fcbb490a073426d699b927a0b1a65d4a8290f35
4
+ data.tar.gz: 0f87a6cdfbaa27f9f1743474f41dca4a0bfccf661277820386d72265278200b0
5
5
  SHA512:
6
- metadata.gz: 20498ab8d23127912ee6007fefb67d0ece0878f406fee095dbbadac8e9b3aef0540481e47a943e11d4513499d7cf53907135e99580884b1dc86bbfdc0694cc1c
7
- data.tar.gz: 86c51a0432acadcdca3f4550e02b74e433cfd68b14aa910f1195f1371427216bbd8d5f30d88e861e66eb4dc3580fd8081c898cdb740bff3fed0cbe6debb20c28
6
+ metadata.gz: 64c1768cd854505513de05cbacc326096ef733965b0897ed874c16ade248c5ca7252cf13026d49efa86c9d31cfb074c700a87d74627313f94a9dd9171bbc7531
7
+ data.tar.gz: 393d0d037e9a88ab10f02f2159f002d35fcc5bde21497e0ce3283e7495ab68bf4b138fd50c5c1814ec2f78aca6115147c6cf37b29c9228def09fbe511ac85338
@@ -1,3 +1,6 @@
1
+ ### 5.8.3 / 2019-05-15
2
+ * Fix the package check to handle building different versions of SIMP
3
+
1
4
  ### 5.8.2 / 2019-05-02
2
5
  * Update the list of packages to check for before building
3
6
  the tar file.
@@ -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
- full_pkg = source.split('/').last
161
- unless File.exist?(full_pkg)
162
- puts("Downloading: #{full_pkg}")
163
- yum_helper.download(source)
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(full_pkg)
167
+ validate_rpm(downloaded_rpm)
167
168
  rescue SIMPBuildException
168
- rm(full_pkg) if File.exist?(full_pkg)
169
+ rm(rpm) if File.exist?(rpm)
169
170
  raise(SIMPBuildException,"#{rpm} could not be downloaded")
170
171
  end
171
172
  end
@@ -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
 
@@ -2,5 +2,5 @@ module Simp; end
2
2
  module Simp::Rake; end
3
3
 
4
4
  class Simp::Rake::Helpers
5
- VERSION = '5.8.2'
5
+ VERSION = '5.8.3'
6
6
  end
@@ -140,11 +140,17 @@ module Simp
140
140
  end
141
141
 
142
142
  def get_sources(rpm)
143
- sources = %x(#{@@yumdownloader} --urls #{File.basename(rpm,'.rpm')} 2>/dev/null).split("\n").grep(%r(\.rpm$))
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
- raise(Error, "No sources found for '#{rpm}'") if sources.empty?
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
- return sources
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
- #FIXME Should really report stderr output so user can
180
- # diagnose the problem
181
- %x(#{@@yumdownloader} #{File.basename(rpm_name, '.rpm')} 2>/dev/null)
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> /dev/null)
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
- raise(Error, "Could not find any remote RPMs for #{rpm}") if rpms.empty?
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'
@@ -120,3 +120,8 @@ HOSTS:
120
120
  CONFIG:
121
121
  log_level: verbose
122
122
  type: aio
123
+ <% if ENV['BEAKER_PUPPET_COLLECTION'] -%>
124
+ puppet_collection: <%= ENV['BEAKER_PUPPET_COLLECTION'] %>
125
+ <% else -%>
126
+ puppet_collection: puppet5
127
+ <% end -%>
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.2
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-03 00:00:00.000000000 Z
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.1
571
+ rubygems_version: 3.0.3
572
572
  signing_key:
573
573
  specification_version: 4
574
574
  summary: SIMP rake helpers