simp-rake-helpers 5.11.1 → 5.11.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -24
- data/CHANGELOG.md +18 -0
- data/Gemfile +5 -1
- data/lib/simp/componentinfo.rb +17 -0
- data/lib/simp/local_gpg_signing_key.rb +99 -45
- data/lib/simp/rake.rb +13 -6
- data/lib/simp/rake/build/build.rb +43 -27
- data/lib/simp/rake/build/constants.rb +5 -1
- data/lib/simp/rake/build/pkg.rb +65 -11
- data/lib/simp/rake/build/rpmdeps.rb +18 -17
- data/lib/simp/rake/build/tar.rb +1 -1
- data/lib/simp/rake/helpers/version.rb +1 -1
- data/lib/simp/relchecks.rb +1 -1
- data/lib/simp/rpm.rb +5 -0
- data/spec/acceptance/nodesets/default.yml +21 -109
- data/spec/lib/simp/ci/files/job_broken_link_nodeset/spec/acceptance/suites/default/nodesets +1 -1
- data/spec/lib/simp/ci/files/job_invalid_nodeset/spec/acceptance/suites/default/nodesets +1 -1
- data/spec/lib/simp/ci/files/job_invalid_suite/spec/acceptance/suites/default/nodesets +1 -1
- data/spec/lib/simp/ci/files/job_missing_nodeset/spec/acceptance/suites/default/nodesets +1 -1
- data/spec/lib/simp/ci/files/job_missing_suite_and_nodeset/spec/acceptance/suites/default/nodesets +1 -1
- data/spec/lib/simp/ci/files/multiple_invalid_jobs/spec/acceptance/suites/default/nodesets +1 -1
- data/spec/lib/simp/ci/files/multiple_valid_jobs/spec/acceptance/suites/default/nodesets +1 -1
- data/spec/lib/simp/ci/files/no_gitlab_config_with_tests/spec/acceptance/suites/default/nodesets +1 -1
- data/spec/lib/simp/ci/files/no_gitlab_config_without_tests/spec/acceptance/suites/default/nodesets +1 -1
- data/spec/lib/simp/ci/files/suite_skeleton_only/spec/acceptance/suites/default/nodesets +1 -1
- data/spec/lib/simp/ci/files/valid_job_nodeset_dir_link/spec/acceptance/suites/default/nodesets +1 -1
- data/spec/lib/simp/ci/gitlab_spec.rb +12 -13
- data/spec/lib/simp/componentinfo_spec.rb +10 -4
- data/spec/lib/simp/files/build/testpackage.spec +1 -1
- data/spec/lib/simp/rake/build/helpers_spec.rb +3 -0
- data/spec/lib/simp/rake/build/rpmdeps_spec.rb +3 -3
- data/spec/lib/simp/rake/pupmod/fixtures/othermod/Gemfile +1 -10
- data/spec/lib/simp/rake/pupmod/fixtures/simpmod/spec/acceptance/suites/default/nodesets +1 -1
- data/spec/lib/simp/rake_spec.rb +2 -1
- data/spec/lib/simp/relchecks_check_rpm_changelog_spec.rb +20 -10
- data/spec/lib/simp/relchecks_compare_latest_tag_spec.rb +18 -18
- data/spec/lib/simp/rpm_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/spec/spec_helper_acceptance.rb +16 -3
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd1fc58d4764acdc2a2160e63a50a2a16015c1dd2a41f7b530baad394d6a397e
|
4
|
+
data.tar.gz: 6f322c3850b40ff56c8aa49a86146a176311e999495ada8cc8270ecf806f2d81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d58adb8bae7eba07b696cbfd3add6ce335672a7ddc6d9063f6057ca3da8f23e5492d6cecb805afe13104f377fac3c16cc38a8925791eef9c3f2543017c609bcf
|
7
|
+
data.tar.gz: baaf3228b15df258dcdd6030f7fa95d995ac4a08cf735218cbc941543eef389c881f9f31bed619d605b230da154fee39353eabcebb9165cbb70f3b44b88e595a
|
data/.travis.yml
CHANGED
@@ -3,35 +3,16 @@ language: ruby
|
|
3
3
|
cache: bundler
|
4
4
|
sudo: false
|
5
5
|
|
6
|
-
bundler_args: --without development system_tests
|
7
|
-
|
8
6
|
notifications:
|
9
7
|
email: false
|
10
8
|
|
11
|
-
addons:
|
12
|
-
apt:
|
13
|
-
packages:
|
14
|
-
- rpm
|
15
|
-
# provides unbuffer
|
16
|
-
- expect-dev
|
17
|
-
|
18
|
-
before_install:
|
19
|
-
- rm -f Gemfile.lock
|
20
|
-
|
21
9
|
jobs:
|
22
10
|
include:
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
- stage: acceptance
|
29
|
-
sudo: required
|
30
|
-
rvm: 2.5.1
|
31
|
-
services:
|
32
|
-
- docker
|
33
|
-
script:
|
34
|
-
- travis_wait 90 unbuffer bundle exec rake acceptance
|
11
|
+
### Testing on Travis CI is indefinitely disabled
|
12
|
+
###
|
13
|
+
### See:
|
14
|
+
### * https://blog.travis-ci.com/2020-11-02-travis-ci-new-billing
|
15
|
+
### * https://simp-project.atlassian.net/browse/SIMP-8703
|
35
16
|
|
36
17
|
- stage: deploy
|
37
18
|
rvm: 2.5.1
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
### 5.11.6 / 2021-02-03
|
2
|
+
* Fix GPG handling for GPG 2.1+
|
3
|
+
|
4
|
+
### 5.11.5 / 2020-12-02
|
5
|
+
* Add support for Puppet 7
|
6
|
+
* Work around issues with querying RPM spec file changelogs using RPM version 4.15.0+
|
7
|
+
* Switch between 'with_unbundled_env' and 'with_clean_env' based on which one
|
8
|
+
Bundler supports.
|
9
|
+
|
10
|
+
### 5.11.4 / 2020-08-03
|
11
|
+
* Permit *.md files in `rake pkg:compare_latest_tag`
|
12
|
+
|
13
|
+
### 5.11.3 / 2020-05-19
|
14
|
+
* Fix automatically added dependencies for SIMP 6.4+
|
15
|
+
|
16
|
+
### 5.11.2 / 2020-04-08
|
17
|
+
* Version information should not be required on dependencies in metadata.json
|
18
|
+
|
1
19
|
### 5.11.1 / 2020-04-07
|
2
20
|
* Puppet module RPM logic handles `-rc0` suffix in `metadata.json`
|
3
21
|
|
data/Gemfile
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
#
|
3
3
|
# SIMP_GEM_SERVERS | a space/comma delimited list of rubygem servers
|
4
4
|
# PUPPET_VERSION | specifies the version of the puppet gem to load
|
5
|
-
puppetversion = ENV.key?('PUPPET_VERSION') ? "#{ENV['PUPPET_VERSION']}" : '~>
|
5
|
+
puppetversion = ENV.key?('PUPPET_VERSION') ? "#{ENV['PUPPET_VERSION']}" : '~> 6'
|
6
6
|
gem_sources = ENV.key?('SIMP_GEM_SERVERS') ? ENV['SIMP_GEM_SERVERS'].split(/[, ]+/) : ['https://rubygems.org']
|
7
7
|
|
8
8
|
gem_sources.each { |gem_source| source gem_source }
|
@@ -13,6 +13,10 @@ gem 'simp-build-helpers'
|
|
13
13
|
gem 'simp-beaker-helpers'
|
14
14
|
gem 'beaker-puppet_install_helper'
|
15
15
|
gem 'rake', '>= 12.3.3'
|
16
|
+
# You'll need the following if using podman until they are released upstream
|
17
|
+
#gem 'beaker-docker', :git => 'https://github.com/trevor-vaughan/beaker-docker', :branch => 'support_rootless_podman'
|
18
|
+
#gem 'docker-api', :git => 'https://github.com/trevor-vaughan/docker-api', :branch => 'podman-compat'
|
19
|
+
gem 'beaker-docker'
|
16
20
|
|
17
21
|
if puppetversion
|
18
22
|
gem 'puppet', puppetversion
|
data/lib/simp/componentinfo.rb
CHANGED
@@ -139,6 +139,23 @@ class Simp::ComponentInfo
|
|
139
139
|
if $?.exitstatus != 0
|
140
140
|
fail("Could not extract changelog from #{rpm_spec_files[0]}." +
|
141
141
|
" To debug, execute:\n #{changelog_query}")
|
142
|
+
elsif raw_changelog.strip.empty?
|
143
|
+
changelog_lines = []
|
144
|
+
|
145
|
+
in_changelog = false
|
146
|
+
File.read(rpm_spec_files[0]).lines.each do |line|
|
147
|
+
changelog_lines << line if in_changelog
|
148
|
+
|
149
|
+
if line.start_with?('%')
|
150
|
+
if line.start_with?('%changelog')
|
151
|
+
in_changelog = true
|
152
|
+
else
|
153
|
+
in_changelog = false
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
raw_changelog = changelog_lines.join
|
142
159
|
end
|
143
160
|
@changelog = parse_changelog(raw_changelog, latest_version_only, verbose)
|
144
161
|
end
|
@@ -78,6 +78,22 @@ module Simp
|
|
78
78
|
@gpg_agent_script = 'run_gpg_agent'
|
79
79
|
end
|
80
80
|
|
81
|
+
# Return the version of GPG instealled on the system
|
82
|
+
#
|
83
|
+
# @return [Gem::Version]
|
84
|
+
def gpg_version
|
85
|
+
return @gpg_version if @gpg_version
|
86
|
+
|
87
|
+
which('gpg', true)
|
88
|
+
@gpg_version = %x{gpg --version}.lines.first.split(/\s+/).last
|
89
|
+
|
90
|
+
unless @gpg_version.nil? || @gpg_version.empty?
|
91
|
+
@gpg_version = Gem::Version.new(@gpg_version)
|
92
|
+
end
|
93
|
+
|
94
|
+
@gpg_version
|
95
|
+
end
|
96
|
+
|
81
97
|
# Returns a gpg-agent's env string, if it can be detected from the
|
82
98
|
# gpg-agent-info file
|
83
99
|
#
|
@@ -99,6 +115,8 @@ module Simp
|
|
99
115
|
def dev_key_days_left
|
100
116
|
ensure_gpg_directory
|
101
117
|
days_left = 0
|
118
|
+
|
119
|
+
which('gpg', true)
|
102
120
|
current_key = %x(GPG_AGENT_INFO='' gpg --homedir=#{@dir} --list-keys #{@key_email} 2>/dev/null)
|
103
121
|
unless current_key.empty?
|
104
122
|
lasts_until = current_key.lines.first.strip.split("\s").last.delete(']')
|
@@ -138,33 +156,54 @@ module Simp
|
|
138
156
|
write_gpg_agent_startup_script
|
139
157
|
|
140
158
|
begin
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
159
|
+
if gpg_version < Gem::Version.new('2.1')
|
160
|
+
# Start the GPG agent.
|
161
|
+
gpg_agent_output = %x(./#{@gpg_agent_script}).strip
|
162
|
+
|
163
|
+
# Provide a local socket (needed by the `gpg` command when
|
164
|
+
local_socket = File.join(Dir.pwd, 'S.gpg-agent')
|
165
|
+
|
166
|
+
# This condition was handled differently in previous logic.
|
167
|
+
#
|
168
|
+
# a.) As the surrounding logic works now, it will _always_ be a new
|
169
|
+
# agent by this point, because the directory is cleaned out
|
170
|
+
# b.) The agent's information will be read from the env-file it
|
171
|
+
# writes at startup
|
172
|
+
# c.) The old command `gpg-agent --homedir=#{Dir.pwd} /get serverpid`
|
173
|
+
# did not work on EL6 or EL7.
|
174
|
+
#
|
175
|
+
warn(empty_gpg_agent_message) if gpg_agent_output.empty?
|
176
|
+
|
177
|
+
agent_info = gpg_agent_info
|
178
|
+
|
179
|
+
# The socket is useful to get back info on the command line.
|
180
|
+
unless File.exist?(File.join(Dir.pwd, File.basename(agent_info[:socket])))
|
181
|
+
ln_s(agent_info[:socket], local_socket, :verbose => @verbose)
|
182
|
+
end
|
183
|
+
|
184
|
+
generate_key(agent_info[:info])
|
185
|
+
else
|
186
|
+
which('gpg', true)
|
187
|
+
which('gpg-agent', true)
|
188
|
+
which('gpg-connect-agent', true)
|
189
|
+
|
190
|
+
# Start the GPG agent
|
191
|
+
%x{gpg-agent --homedir=#{Dir.pwd} >&/dev/null || gpg-agent --homedir=#{Dir.pwd} --daemon >&/dev/null}
|
192
|
+
|
193
|
+
agent_info = {}
|
194
|
+
|
195
|
+
# Provide a local socket (needed by the `gpg` command when
|
196
|
+
agent_info[:socket] = %x{echo 'GETINFO socket_name' | gpg-connect-agent --homedir=#{Dir.pwd}}.lines.first[1..-1].strip
|
197
|
+
|
198
|
+
# Get the pid
|
199
|
+
agent_info[:pid] = %x{echo 'GETINFO pid' | gpg-connect-agent --homedir=#{Dir.pwd}}.lines.first[1..-1].strip.to_i
|
200
|
+
|
201
|
+
generate_key(%{#{agent_info[:socket]}:#{agent_info[:pid]}:1})
|
163
202
|
end
|
164
|
-
generate_key(agent_info[:info])
|
165
203
|
ensure
|
166
204
|
kill_agent(agent_info[:pid])
|
167
205
|
end
|
206
|
+
|
168
207
|
agent_info
|
169
208
|
end
|
170
209
|
end
|
@@ -209,11 +248,18 @@ module Simp
|
|
209
248
|
# @param gpg_agent_info_str [String] value to set the GPG_AGENT_INFO
|
210
249
|
# environment variable to use in order to use the correct `gpg-agent`.
|
211
250
|
def generate_key(gpg_agent_info_str)
|
251
|
+
which('gpg', true)
|
252
|
+
|
212
253
|
puts "Generating new GPG key#{@verbose ? " under '#{@dir}'" : ''}..."
|
213
254
|
gpg_cmd = %(GPG_AGENT_INFO=#{gpg_agent_info_str} gpg --homedir="#{@dir}")
|
255
|
+
|
214
256
|
pipe = @verbose ? '| tee' : '>'
|
215
257
|
sh %(#{gpg_cmd} --batch --gen-key #{GPG_GENKEY_PARAMS_FILENAME})
|
216
258
|
sh %(#{gpg_cmd} --armor --export #{@key_email} #{pipe} "#{@key_file}")
|
259
|
+
|
260
|
+
if File.stat(@key_file).size == 0
|
261
|
+
fail "Error: Something went wrong generating #{@key_file}"
|
262
|
+
end
|
217
263
|
end
|
218
264
|
|
219
265
|
# Return a data structure from a gpg-agent env-file formatted string.
|
@@ -232,38 +278,46 @@ module Simp
|
|
232
278
|
def write_genkey_parameter_file
|
233
279
|
now = Time.now.to_i.to_s
|
234
280
|
expire_date = Date.today + 14
|
235
|
-
passphrase = SecureRandom.base64(
|
236
|
-
genkey_parameters =
|
237
|
-
%echo Generating Development GPG Key
|
238
|
-
%echo
|
239
|
-
%echo This key will expire on #{expire_date}
|
240
|
-
%echo
|
241
|
-
Key-Type: RSA
|
242
|
-
Key-Length: 4096
|
243
|
-
Key-Usage: sign
|
244
|
-
Name-Real: SIMP Development
|
245
|
-
Name-Comment: Development key #{now}
|
246
|
-
Name-Email: #{@key_email}
|
247
|
-
Expire-Date: 2w
|
248
|
-
Passphrase: #{passphrase}
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
%
|
253
|
-
|
254
|
-
|
255
|
-
|
281
|
+
passphrase = SecureRandom.base64(100)
|
282
|
+
genkey_parameters = [
|
283
|
+
'%echo Generating Development GPG Key',
|
284
|
+
'%echo',
|
285
|
+
"%echo This key will expire on #{expire_date}",
|
286
|
+
'%echo',
|
287
|
+
'Key-Type: RSA',
|
288
|
+
'Key-Length: 4096',
|
289
|
+
'Key-Usage: sign',
|
290
|
+
'Name-Real: SIMP Development',
|
291
|
+
"Name-Comment: Development key #{now}",
|
292
|
+
"Name-Email: #{@key_email}",
|
293
|
+
'Expire-Date: 2w',
|
294
|
+
"Passphrase: #{passphrase}",
|
295
|
+
]
|
296
|
+
|
297
|
+
if gpg_version < Gem::Version.new('2.1')
|
298
|
+
genkey_parameters << '%pubring pubring.gpg'
|
299
|
+
genkey_parameters << '%secring secring.gpg'
|
300
|
+
end
|
301
|
+
|
302
|
+
genkey_parameters << '# The following creates the key, so we can print "Done!" afterwards'
|
303
|
+
genkey_parameters << '%commit'
|
304
|
+
genkey_parameters << '%echo New GPG Development Key Created'
|
305
|
+
|
306
|
+
File.open(GPG_GENKEY_PARAMS_FILENAME, 'w') { |fh| fh.puts(genkey_parameters.join("\n")) }
|
256
307
|
end
|
257
308
|
|
258
309
|
# Write a local gpg-agent daemon script file
|
259
310
|
def write_gpg_agent_startup_script
|
311
|
+
which('gpg-agent', true)
|
312
|
+
pinentry_cmd = which('pinentry-curses', true)
|
313
|
+
|
260
314
|
gpg_agent_script = <<-AGENT_SCRIPT.gsub(%r{^ {20}}, '')
|
261
315
|
#!/bin/sh
|
262
316
|
|
263
317
|
gpg-agent --homedir=#{Dir.pwd} --daemon \
|
264
318
|
--no-use-standard-socket --sh --batch \
|
265
319
|
--write-env-file "#{@gpg_agent_env_file}" \
|
266
|
-
--pinentry-program
|
320
|
+
--pinentry-program #{pinentry_cmd} < /dev/null &
|
267
321
|
AGENT_SCRIPT
|
268
322
|
|
269
323
|
File.open(@gpg_agent_script, 'w') { |fh| fh.puts(gpg_agent_script) }
|
data/lib/simp/rake.rb
CHANGED
@@ -96,14 +96,21 @@ module Simp::Rake
|
|
96
96
|
exec pager rescue exec "/bin/sh", "-c", pager
|
97
97
|
end
|
98
98
|
|
99
|
-
|
100
|
-
|
101
|
-
def which(cmd)
|
102
|
-
command = Facter::Core::Execution.which(cmd)
|
99
|
+
def which(cmd, fail=false)
|
100
|
+
@which_cache ||= {}
|
103
101
|
|
104
|
-
|
102
|
+
if @which_cache.has_key?(cmd)
|
103
|
+
command = @which_cache[cmd]
|
104
|
+
else
|
105
|
+
command = Facter::Core::Execution.which(cmd)
|
106
|
+
@which_cache[cmd] = command
|
107
|
+
end
|
108
|
+
|
109
|
+
msg = "Warning: Command #{cmd} not found on the system."
|
110
|
+
|
111
|
+
fail ? raise(msg) : warn(msg) unless command
|
105
112
|
|
106
|
-
|
113
|
+
command
|
107
114
|
end
|
108
115
|
|
109
116
|
def help
|
@@ -76,7 +76,8 @@ module Simp::Rake::Build
|
|
76
76
|
#
|
77
77
|
# Clean env will give bundler the environment present before
|
78
78
|
# Bundler is activated.
|
79
|
-
|
79
|
+
clean_env_method = Bundler.respond_to?(:with_unbundled_env) ? :with_unbundled_env : :with_clean_env
|
80
|
+
::Bundler.send(clean_env_method) do
|
80
81
|
out = %x(bundle #{args[:action]} 2>&1)
|
81
82
|
status = $?.success?
|
82
83
|
puts out if verbose
|
@@ -94,6 +95,7 @@ module Simp::Rake::Build
|
|
94
95
|
namespace :yum do
|
95
96
|
task :prep do
|
96
97
|
if $simp6
|
98
|
+
# `$simp6_build_dir` is set by the build:auto task
|
97
99
|
@build_dir = $simp6_build_dir
|
98
100
|
|
99
101
|
unless @build_dir
|
@@ -469,10 +471,10 @@ module Simp::Rake::Build
|
|
469
471
|
##############################################################################
|
470
472
|
|
471
473
|
desc <<-EOM
|
472
|
-
Create a
|
474
|
+
Create a new yum directory tree for a new distribution.
|
473
475
|
|
474
|
-
Creates a YUM
|
475
|
-
|
476
|
+
Creates a YUM directory tree under
|
477
|
+
{dist_build_dir}/yum_data/SIMP{:simp_version}_{:os}{:os_version}_{:arch}.
|
476
478
|
|
477
479
|
* :os - The Operating System that you wish to use.
|
478
480
|
Supported OSs: #{@target_dists}.join(', ')
|
@@ -482,31 +484,45 @@ module Simp::Rake::Build
|
|
482
484
|
Default: Auto
|
483
485
|
|
484
486
|
* :arch - The architecture that you support. Default: x86_64
|
487
|
+
|
488
|
+
Set ENV['SIMP_BUILD_yum_dir'] to override the path of {dist_build_dir}
|
489
|
+
|
490
|
+
Will not overwrite existing directories or package.yaml files
|
485
491
|
EOM
|
486
|
-
task :scaffold,[:os,:os_version,:simp_version,:arch]
|
492
|
+
task :scaffold,[:os,:os_version,:simp_version,:arch] do |t,args|
|
487
493
|
# @simp_version is set in the main Rakefile
|
488
494
|
args.with_defaults(:simp_version => @simp_version.split('-').first)
|
489
495
|
args.with_defaults(:arch => @build_arch)
|
490
496
|
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
497
|
+
major_os_ver = args[:os_version].split('.').first
|
498
|
+
build_dir = distro_build_dir(
|
499
|
+
File.join(@base_dir,'build'), args[:os], major_os_ver, args[:arch]
|
500
|
+
)
|
501
|
+
build_dir = ENV['SIMP_BUILD_yum_dir'] if File.directory?(ENV['SIMP_BUILD_yum_dir'].to_s)
|
502
|
+
ENV['SIMP_BUILD_yum_dir'] ||= build_dir # <-- for hacky :prep task
|
503
|
+
|
504
|
+
target_dir = File.join(build_dir,'yum_data')
|
505
|
+
|
506
|
+
# Create directories
|
507
|
+
my_repos = $simp6 ? '../my_repos' : 'my_repos'
|
508
|
+
[
|
509
|
+
target_dir,
|
510
|
+
File.join(target_dir,'repos'),
|
511
|
+
File.join(target_dir,'packages'),
|
512
|
+
File.expand_path(my_repos,target_dir)
|
513
|
+
].each { |dir| mkdir_p(dir, verbose: false) }
|
514
|
+
|
515
|
+
# Create example packages.yaml
|
516
|
+
packages_yaml_path = File.join(target_dir, 'packages.yaml')
|
517
|
+
unless File.exists? packages_yaml_path
|
518
|
+
pkg = 'example-package-name'
|
519
|
+
pkg_file = "#{pkg}-1.0.0-1.el#{major_os_ver}.#{args[:arch]}.rpm"
|
520
|
+
yum_url = "https://yum.server/#{args[:os]}/#{major_os_ver}/#{args[:arch]}"
|
521
|
+
pkg_url = "#{yum_url}/#{pkg_file}"
|
522
|
+
yaml = { pkg => { rpm_name: pkg_file, source: pkg_url } }.to_yaml
|
523
|
+
File.open(packages_yaml_path,'w'){|f| f.puts yaml.gsub(/^/,'# ') }
|
524
|
+
puts "Created #{target_dir}"
|
525
|
+
puts "Created example file at #{packages_yaml_path}"
|
510
526
|
end
|
511
527
|
end
|
512
528
|
|
@@ -525,7 +541,7 @@ module Simp::Rake::Build
|
|
525
541
|
|
526
542
|
* :arch - The architecture that you support. Default: x86_64
|
527
543
|
EOM
|
528
|
-
task :sync,[:os,:os_version,:simp_version,:arch] => [:
|
544
|
+
task :sync,[:os,:os_version,:simp_version,:arch] => [:scaffold, :prep] do |t,args|
|
529
545
|
# @simp_version is set in the main Rakefile
|
530
546
|
args.with_defaults(:simp_version => @simp_version.split('-').first)
|
531
547
|
args.with_defaults(:arch => @build_arch)
|
@@ -550,7 +566,7 @@ module Simp::Rake::Build
|
|
550
566
|
|
551
567
|
* :arch - The architecture that you support. Default: x86_64
|
552
568
|
EOM
|
553
|
-
task :diff,[:os,:os_version,:simp_version,:arch] => [:
|
569
|
+
task :diff,[:os,:os_version,:simp_version,:arch] => [:scaffold, :prep] do |t,args|
|
554
570
|
args.with_defaults(:simp_version => @simp_version.split('-').first)
|
555
571
|
args.with_defaults(:arch => @build_arch)
|
556
572
|
|
@@ -616,7 +632,7 @@ module Simp::Rake::Build
|
|
616
632
|
|
617
633
|
* :arch - The architecture that you support. Default: x86_64
|
618
634
|
EOM
|
619
|
-
task :fetch,[:pkg,:os,:os_version,:simp_version,:arch] => [:
|
635
|
+
task :fetch,[:pkg,:os,:os_version,:simp_version,:arch] => [:scaffold, :prep] do |t,args|
|
620
636
|
args.with_defaults(:simp_version => @simp_version.split('-').first)
|
621
637
|
args.with_defaults(:arch => @build_arch)
|
622
638
|
|