simp-rake-helpers 5.25.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +26 -0
- data/Gemfile +13 -6
- data/lib/simp/command_utils.rb +6 -3
- data/lib/simp/componentinfo.rb +47 -33
- data/lib/simp/local_gpg_signing_key.rb +302 -303
- data/lib/simp/packer/iso_vars_json.rb +17 -15
- data/lib/simp/rake/build/auto.rb +415 -432
- data/lib/simp/rake/build/build.rb +119 -124
- data/lib/simp/rake/build/clean.rb +39 -39
- data/lib/simp/rake/build/code.rb +125 -128
- data/lib/simp/rake/build/constants.rb +7 -4
- data/lib/simp/rake/build/deps.rb +196 -207
- data/lib/simp/rake/build/helpers.rb +17 -13
- data/lib/simp/rake/build/iso.rb +404 -411
- data/lib/simp/rake/build/pkg.rb +752 -759
- data/lib/simp/rake/build/rpmdeps.rb +70 -70
- data/lib/simp/rake/build/spec.rb +44 -46
- data/lib/simp/rake/build/tar.rb +169 -173
- data/lib/simp/rake/build/unpack.rb +105 -107
- data/lib/simp/rake/build/upload.rb +93 -102
- data/lib/simp/rake/fixtures.rb +69 -66
- data/lib/simp/rake/helpers/rpm_spec.rb +10 -7
- data/lib/simp/rake/helpers/version.rb +3 -1
- data/lib/simp/rake/helpers.rb +12 -10
- data/lib/simp/rake/pkg.rb +417 -440
- data/lib/simp/rake/pupmod/helpers.rb +100 -87
- data/lib/simp/rake/pupmod/module_build.rb +39 -0
- data/lib/simp/rake/rubygem.rb +57 -56
- data/lib/simp/rake.rb +34 -29
- data/lib/simp/relchecks.rb +52 -43
- data/lib/simp/rpm.rb +123 -127
- data/lib/simp/rpm_signer.rb +57 -55
- data/lib/simp/yum.rb +54 -53
- data/spec/acceptance/nodesets/{default_ruby3_1.yml → almalinux10.yml} +4 -4
- data/spec/acceptance/nodesets/{default.yml → almalinux8.yml} +2 -2
- data/spec/acceptance/nodesets/almalinux9.yml +25 -0
- data/spec/acceptance/suites/default/00_pkg_rpm_custom_scriptlets_spec.rb +23 -28
- data/spec/acceptance/suites/default/10_pkg_rpm_spec.rb +54 -56
- data/spec/acceptance/suites/default/30_pkg_misc_spec.rb +17 -19
- data/spec/acceptance/suites/default/50_local_gpg_signing_key_spec.rb +5 -5
- data/spec/acceptance/suites/default/55_build_pkg_signing_spec.rb +109 -101
- data/spec/acceptance/suites/default/files/testpackage/spec/classes/init_spec.rb +1 -0
- data/spec/acceptance/suites/default/files/testpackage/spec/files/mock_something.rb +3 -1
- data/spec/acceptance/suites/default/files/testpackage/utils/convert_v1_to_v2.rb +2 -0
- data/spec/acceptance/suites/default/support/build_project_helpers.rb +20 -17
- data/spec/acceptance/suites/default/support/build_user_helpers.rb +4 -2
- data/spec/acceptance/suites/default/support/pkg_rpm_helpers.rb +30 -31
- data/spec/acceptance/support/simp_rake_helpers.rb +3 -1
- data/spec/lib/simp/command_utils_spec.rb +13 -10
- data/spec/lib/simp/componentinfo_changelog_regex_spec.rb +33 -33
- data/spec/lib/simp/componentinfo_spec.rb +99 -86
- data/spec/lib/simp/packer/iso_vars_json_spec.rb +16 -14
- data/spec/lib/simp/rake/build/helpers_spec.rb +7 -7
- data/spec/lib/simp/rake/build/rpmdeps_spec.rb +48 -46
- data/spec/lib/simp/rake/helpers_spec.rb +6 -5
- data/spec/lib/simp/rake/pkg_spec.rb +7 -5
- data/spec/lib/simp/rake/pupmod/fixtures/othermod/spec/classes/init_spec.rb +3 -1
- data/spec/lib/simp/rake/pupmod/fixtures/othermod/spec/spec_helper.rb +2 -0
- data/spec/lib/simp/rake/pupmod/fixtures/simpmod/spec/acceptance/suites/default/class_spec.rb +6 -5
- data/spec/lib/simp/rake/pupmod/fixtures/simpmod/spec/classes/init_spec.rb +51 -33
- data/spec/lib/simp/rake/pupmod/fixtures/simpmod/spec/spec_helper.rb +15 -16
- data/spec/lib/simp/rake/pupmod/fixtures/simpmod/spec/spec_helper_acceptance.rb +9 -9
- data/spec/lib/simp/rake/pupmod/helpers_spec.rb +20 -19
- data/spec/lib/simp/rake/pupmod/module_build_spec.rb +87 -0
- data/spec/lib/simp/rake_spec.rb +7 -6
- data/spec/lib/simp/relchecks_check_rpm_changelog_spec.rb +26 -31
- data/spec/lib/simp/relchecks_compare_latest_tag_spec.rb +32 -26
- data/spec/lib/simp/relchecks_create_tag_changelog_spec.rb +27 -19
- data/spec/lib/simp/rpm_signer_spec.rb +45 -39
- data/spec/lib/simp/rpm_spec.rb +190 -194
- data/spec/spec_helper.rb +4 -2
- data/spec/spec_helper_acceptance.rb +3 -5
- metadata +37 -72
- data/bin/simp_rake_helpers +0 -3
- data/lib/simp/ci/gitlab.rb +0 -226
- data/lib/simp/rake/ci.rb +0 -31
- data/spec/lib/simp/ci/files/global_nodesets_only/spec/acceptance/nodesets/default.yml +0 -41
- data/spec/lib/simp/ci/files/global_nodesets_only/spec/acceptance/nodesets/oel.yml +0 -41
- data/spec/lib/simp/ci/files/job_broken_link_nodeset/spec/acceptance/nodesets/centos.yml +0 -41
- data/spec/lib/simp/ci/files/job_broken_link_nodeset/spec/acceptance/nodesets/oel.yml +0 -41
- data/spec/lib/simp/ci/files/job_broken_link_nodeset/spec/acceptance/suites/default/class_spec.rb +0 -0
- data/spec/lib/simp/ci/files/job_invalid_nodeset/spec/acceptance/nodesets/default.yml +0 -41
- data/spec/lib/simp/ci/files/job_invalid_nodeset/spec/acceptance/nodesets/oel.yml +0 -41
- data/spec/lib/simp/ci/files/job_invalid_nodeset/spec/acceptance/suites/default/class_spec.rb +0 -0
- data/spec/lib/simp/ci/files/job_invalid_suite/spec/acceptance/nodesets/default.yml +0 -41
- data/spec/lib/simp/ci/files/job_invalid_suite/spec/acceptance/nodesets/oel.yml +0 -41
- data/spec/lib/simp/ci/files/job_invalid_suite/spec/acceptance/suites/default/class_spec.rb +0 -0
- data/spec/lib/simp/ci/files/job_missing_nodeset/spec/acceptance/nodesets/default.yml +0 -41
- data/spec/lib/simp/ci/files/job_missing_nodeset/spec/acceptance/nodesets/oel.yml +0 -41
- data/spec/lib/simp/ci/files/job_missing_nodeset/spec/acceptance/suites/default/class_spec.rb +0 -0
- data/spec/lib/simp/ci/files/job_missing_suite_and_nodeset/spec/acceptance/nodesets/default.yml +0 -41
- data/spec/lib/simp/ci/files/job_missing_suite_and_nodeset/spec/acceptance/nodesets/oel.yml +0 -41
- data/spec/lib/simp/ci/files/job_missing_suite_and_nodeset/spec/acceptance/suites/default/class_spec.rb +0 -0
- data/spec/lib/simp/ci/files/multiple_invalid_jobs/spec/acceptance/nodesets/default.yml +0 -41
- data/spec/lib/simp/ci/files/multiple_invalid_jobs/spec/acceptance/nodesets/oel.yml +0 -41
- data/spec/lib/simp/ci/files/multiple_invalid_jobs/spec/acceptance/suites/default/class_spec.rb +0 -0
- data/spec/lib/simp/ci/files/multiple_invalid_jobs/spec/acceptance/suites/feature-1/feature-1_spec.rb +0 -0
- data/spec/lib/simp/ci/files/multiple_invalid_jobs/spec/acceptance/suites/feature_2/feature_2_spec.rb +0 -0
- data/spec/lib/simp/ci/files/multiple_invalid_jobs/spec/acceptance/suites/feature_2/nodesets/default.yml +0 -35
- data/spec/lib/simp/ci/files/multiple_invalid_jobs/spec/acceptance/suites/feature_2/nodesets/oel.yml +0 -35
- data/spec/lib/simp/ci/files/multiple_valid_jobs/spec/acceptance/nodesets/default.yml +0 -41
- data/spec/lib/simp/ci/files/multiple_valid_jobs/spec/acceptance/nodesets/oel.yml +0 -41
- data/spec/lib/simp/ci/files/multiple_valid_jobs/spec/acceptance/suites/default/class_spec.rb +0 -0
- data/spec/lib/simp/ci/files/multiple_valid_jobs/spec/acceptance/suites/feature-1/feature-1_spec.rb +0 -0
- data/spec/lib/simp/ci/files/multiple_valid_jobs/spec/acceptance/suites/feature_2/feature_2_spec.rb +0 -0
- data/spec/lib/simp/ci/files/multiple_valid_jobs/spec/acceptance/suites/feature_2/nodesets/default.yml +0 -35
- data/spec/lib/simp/ci/files/multiple_valid_jobs/spec/acceptance/suites/feature_2/nodesets/oel.yml +0 -35
- data/spec/lib/simp/ci/files/no_acceptance_tests/spec/spec_helper.rb +0 -0
- data/spec/lib/simp/ci/files/no_gitlab_config_with_tests/spec/acceptance/nodesets/default.yml +0 -41
- data/spec/lib/simp/ci/files/no_gitlab_config_with_tests/spec/acceptance/nodesets/oel.yml +0 -41
- data/spec/lib/simp/ci/files/no_gitlab_config_with_tests/spec/acceptance/suites/default/class_spec.rb +0 -0
- data/spec/lib/simp/ci/files/no_gitlab_config_without_tests/spec/acceptance/nodesets/default.yml +0 -41
- data/spec/lib/simp/ci/files/no_gitlab_config_without_tests/spec/acceptance/nodesets/oel.yml +0 -41
- data/spec/lib/simp/ci/files/suite_skeleton_only/spec/acceptance/nodesets/centos.yml +0 -41
- data/spec/lib/simp/ci/files/suite_skeleton_only/spec/acceptance/nodesets/oel.yml +0 -41
- data/spec/lib/simp/ci/files/valid_job_global_nodeset/spec/acceptance/nodesets/default.yml +0 -41
- data/spec/lib/simp/ci/files/valid_job_global_nodeset/spec/acceptance/nodesets/oel.yml +0 -41
- data/spec/lib/simp/ci/files/valid_job_global_nodeset/spec/acceptance/suites/default/class_spec.rb +0 -0
- data/spec/lib/simp/ci/files/valid_job_nodeset_dir_link/spec/acceptance/nodesets/default.yml +0 -41
- data/spec/lib/simp/ci/files/valid_job_nodeset_dir_link/spec/acceptance/nodesets/oel.yml +0 -41
- data/spec/lib/simp/ci/files/valid_job_nodeset_dir_link/spec/acceptance/suites/default/class_spec.rb +0 -0
- data/spec/lib/simp/ci/files/valid_job_nodeset_link/spec/acceptance/suites/default/class_spec.rb +0 -0
- data/spec/lib/simp/ci/files/valid_job_nodeset_link/spec/acceptance/suites/default/nodesets/centos.yml +0 -41
- data/spec/lib/simp/ci/files/valid_job_nodeset_link/spec/acceptance/suites/default/nodesets/oel.yml +0 -41
- data/spec/lib/simp/ci/files/valid_job_suite_nodeset/spec/acceptance/suites/default/class_spec.rb +0 -0
- data/spec/lib/simp/ci/files/valid_job_suite_nodeset/spec/acceptance/suites/default/nodesets/default.yml +0 -41
- data/spec/lib/simp/ci/files/valid_job_suite_nodeset/spec/acceptance/suites/default/nodesets/oel.yml +0 -41
- data/spec/lib/simp/ci/gitlab_spec.rb +0 -245
data/lib/simp/rake/build/auto.rb
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/rake -T
|
|
2
|
+
# frozen_string_literal: true
|
|
2
3
|
|
|
3
4
|
require 'simp/rake'
|
|
4
5
|
require 'json'
|
|
@@ -14,74 +15,72 @@ end
|
|
|
14
15
|
require 'simp/build/release_mapper'
|
|
15
16
|
module Simp; end
|
|
16
17
|
module Simp::Rake; end
|
|
17
|
-
module Simp::Rake::Build
|
|
18
|
-
class Auto < ::Rake::TaskLib
|
|
19
|
-
|
|
20
|
-
# Commands that are required by some part of the rake stack
|
|
21
|
-
#
|
|
22
|
-
# Use an array for commands that may have multiple valid options
|
|
23
|
-
BUILD_REQUIRED_COMMANDS = [
|
|
24
|
-
'basename',
|
|
25
|
-
'cat',
|
|
26
|
-
'checkmodule',
|
|
27
|
-
'chmod',
|
|
28
|
-
'cp',
|
|
29
|
-
'cpio',
|
|
30
|
-
'createrepo',
|
|
31
|
-
'date',
|
|
32
|
-
'diff',
|
|
33
|
-
'dirname',
|
|
34
|
-
'file',
|
|
35
|
-
'find',
|
|
36
|
-
'gawk',
|
|
37
|
-
'git',
|
|
38
|
-
'gpg',
|
|
39
|
-
'grep',
|
|
40
|
-
'gzip',
|
|
41
|
-
'implantisomd5',
|
|
42
|
-
'install',
|
|
43
|
-
'isoinfo',
|
|
44
|
-
'm4',
|
|
45
|
-
'make',
|
|
46
|
-
'mkdir',
|
|
47
|
-
'mktemp',
|
|
48
|
-
['python','python2','python3'],
|
|
49
|
-
'readlink',
|
|
50
|
-
'repoclosure',
|
|
51
|
-
'rm',
|
|
52
|
-
'rpm',
|
|
53
|
-
'rpmbuild',
|
|
54
|
-
'rpmdb',
|
|
55
|
-
'rpmsign',
|
|
56
|
-
'sed',
|
|
57
|
-
'semodule_package',
|
|
58
|
-
'setfacl',
|
|
59
|
-
'sh',
|
|
60
|
-
'sort',
|
|
61
|
-
'tail',
|
|
62
|
-
'tar',
|
|
63
|
-
'uname',
|
|
64
|
-
'uniq',
|
|
65
|
-
'wc',
|
|
66
|
-
'which',
|
|
67
|
-
'xargs',
|
|
68
|
-
['dnf','yum'],
|
|
69
|
-
'yumdownloader'
|
|
70
|
-
]
|
|
71
|
-
|
|
72
|
-
include Simp::Rake::Build::Constants
|
|
73
|
-
|
|
74
|
-
def initialize( run_dir )
|
|
75
|
-
init_member_vars(run_dir)
|
|
76
|
-
|
|
77
|
-
define
|
|
78
|
-
end
|
|
79
18
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
19
|
+
class Simp::Rake::Build::Auto < Rake::TaskLib
|
|
20
|
+
# Commands that are required by some part of the rake stack
|
|
21
|
+
#
|
|
22
|
+
# Use an array for commands that may have multiple valid options
|
|
23
|
+
BUILD_REQUIRED_COMMANDS = [
|
|
24
|
+
'basename',
|
|
25
|
+
'cat',
|
|
26
|
+
'checkmodule',
|
|
27
|
+
'chmod',
|
|
28
|
+
'cp',
|
|
29
|
+
'cpio',
|
|
30
|
+
'createrepo',
|
|
31
|
+
'date',
|
|
32
|
+
'diff',
|
|
33
|
+
'dirname',
|
|
34
|
+
'file',
|
|
35
|
+
'find',
|
|
36
|
+
'gawk',
|
|
37
|
+
'git',
|
|
38
|
+
'gpg',
|
|
39
|
+
'grep',
|
|
40
|
+
'gzip',
|
|
41
|
+
'implantisomd5',
|
|
42
|
+
'install',
|
|
43
|
+
'isoinfo',
|
|
44
|
+
'm4',
|
|
45
|
+
'make',
|
|
46
|
+
'mkdir',
|
|
47
|
+
'mktemp',
|
|
48
|
+
['python', 'python2', 'python3'],
|
|
49
|
+
'readlink',
|
|
50
|
+
'repoclosure',
|
|
51
|
+
'rm',
|
|
52
|
+
'rpm',
|
|
53
|
+
'rpmbuild',
|
|
54
|
+
'rpmdb',
|
|
55
|
+
'rpmsign',
|
|
56
|
+
'sed',
|
|
57
|
+
'semodule_package',
|
|
58
|
+
'setfacl',
|
|
59
|
+
'sh',
|
|
60
|
+
'sort',
|
|
61
|
+
'tail',
|
|
62
|
+
'tar',
|
|
63
|
+
'uname',
|
|
64
|
+
'uniq',
|
|
65
|
+
'wc',
|
|
66
|
+
'which',
|
|
67
|
+
'xargs',
|
|
68
|
+
['dnf', 'yum'],
|
|
69
|
+
'yumdownloader',
|
|
70
|
+
].freeze
|
|
71
|
+
|
|
72
|
+
include Simp::Rake::Build::Constants
|
|
73
|
+
|
|
74
|
+
def initialize(run_dir)
|
|
75
|
+
init_member_vars(run_dir)
|
|
76
|
+
|
|
77
|
+
define
|
|
78
|
+
end
|
|
83
79
|
|
|
84
|
-
|
|
80
|
+
# define rake tasks
|
|
81
|
+
def define
|
|
82
|
+
namespace :build do
|
|
83
|
+
desc <<-EOM
|
|
85
84
|
Automatically detect and build a SIMP ISO for a target SIMP release.
|
|
86
85
|
|
|
87
86
|
This task runs all other build tasks
|
|
@@ -120,424 +119,408 @@ module Simp::Rake::Build
|
|
|
120
119
|
- SIMP_BUILD_verbose => 'yes' enables verbose reporting. [Default: 'no']
|
|
121
120
|
- SIMP_BUILD_signing_key => The name of the GPG key to use to sign packages. [Default: 'dev']
|
|
122
121
|
- SIMP_BUILD_reposync_only => 'yes' skips unpacking the locally-build tarball so that you only get items from the reposync directory (if present)
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
if resp.empty? || (resp =~ /^(n|N)/)
|
|
206
|
-
tarball = tar_file
|
|
207
|
-
valid_entry = true
|
|
208
|
-
elsif resp =~ /^(y|Y)/
|
|
209
|
-
tarball = false
|
|
210
|
-
valid_entry = true
|
|
211
|
-
|
|
212
|
-
if verbose
|
|
213
|
-
$stderr.puts("Notice: Overwriting existing tarball at #{tar_file}")
|
|
214
|
-
$stderr.puts("Notice: PRESS CTRL-C WITHIN 5 SECONDS TO CANCEL")
|
|
215
|
-
end
|
|
216
|
-
|
|
217
|
-
sleep(5)
|
|
218
|
-
else
|
|
219
|
-
puts("Invalid input: '#{resp}', please try again")
|
|
220
|
-
end
|
|
221
|
-
end
|
|
222
|
-
else
|
|
223
|
-
unless (build_overlay)
|
|
122
|
+
EOM
|
|
123
|
+
|
|
124
|
+
task :auto, [:iso_paths,
|
|
125
|
+
:release,
|
|
126
|
+
:output_dir,
|
|
127
|
+
:do_checksum,
|
|
128
|
+
:key_name] do |_t, args|
|
|
129
|
+
Simp::Rake::Helpers.check_required_commands(BUILD_REQUIRED_COMMANDS)
|
|
130
|
+
|
|
131
|
+
args.with_defaults(
|
|
132
|
+
:iso_paths => ENV['SIMP_BUILD_isos'] || Dir.pwd,
|
|
133
|
+
:distribution => 'ALL',
|
|
134
|
+
:release => [@simp_version.split('.').first, 'X'].join('.'),
|
|
135
|
+
:output_dir => '',
|
|
136
|
+
:do_checksum => 'false',
|
|
137
|
+
:key_name => ENV['SIMP_BUILD_signing_key'] || 'dev',
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
reposync_only = ENV.fetch('SIMP_BUILD_reposync_only', 'no') == 'yes'
|
|
141
|
+
iso_paths = File.expand_path(args[:iso_paths])
|
|
142
|
+
target_release = args[:release]
|
|
143
|
+
do_checksum = (args.do_checksum = (~ %r{^$}) ? 'false' : args.do_checksum)
|
|
144
|
+
key_name = args[:key_name]
|
|
145
|
+
verbose = ENV.fetch('SIMP_BUILD_verbose', 'no') == 'yes'
|
|
146
|
+
prompt = ENV.fetch('SIMP_BUILD_prompt', 'yes') != 'no'
|
|
147
|
+
method = ENV.fetch('SIMP_BUILD_puppetfile', 'tracking')
|
|
148
|
+
do_rm_staging = ENV.fetch('SIMP_BUILD_rm_staging_dir', 'yes') == 'yes'
|
|
149
|
+
build_overlay = ENV.fetch('SIMP_BUILD_overlay', 'yes') == 'yes'
|
|
150
|
+
do_docs = (ENV['SIMP_BUILD_docs'] == 'yes') ? 'true' : 'false'
|
|
151
|
+
do_merge = ENV['SIMP_BUILD_unpack_merge'] != 'no'
|
|
152
|
+
do_prune = (ENV['SIMP_BUILD_prune'] == 'no') ? 'false' : 'true'
|
|
153
|
+
do_checkout = ENV['SIMP_BUILD_checkout'] != 'no'
|
|
154
|
+
do_bundle = ENV['SIMP_BUILD_bundle'] == 'yes'
|
|
155
|
+
do_unpack = ENV['SIMP_BUILD_unpack'] != 'no'
|
|
156
|
+
full_iso_name = ENV.fetch('SIMP_BUILD_iso_name', false)
|
|
157
|
+
iso_name_tag = ENV.fetch('SIMP_BUILD_iso_tag', false)
|
|
158
|
+
|
|
159
|
+
iso_status = {}
|
|
160
|
+
|
|
161
|
+
distro = @build_distro
|
|
162
|
+
version = @build_version
|
|
163
|
+
arch = @build_arch
|
|
164
|
+
|
|
165
|
+
tarball = false
|
|
166
|
+
repo_root_dir = File.expand_path(@base_dir)
|
|
167
|
+
|
|
168
|
+
raise("Cannot Build: No directory '#{@distro_build_dir}' found") unless File.directory?(@distro_build_dir)
|
|
169
|
+
|
|
170
|
+
begin
|
|
171
|
+
# For subtask mangling
|
|
172
|
+
$simp6_build_dir = @distro_build_dir
|
|
173
|
+
$simp6_build_metadata = {
|
|
174
|
+
:distro => distro,
|
|
175
|
+
:version => version,
|
|
176
|
+
:arch => arch
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
output_dir = args[:output_dir].sub(%r{^$}, File.expand_path('SIMP_ISO', @distro_build_dir))
|
|
180
|
+
|
|
181
|
+
staging_dir = ENV.fetch('SIMP_BUILD_staging_dir', File.expand_path('SIMP_ISO_STAGING', @distro_build_dir))
|
|
182
|
+
|
|
183
|
+
overlay_dir = File.join(@distro_build_dir, 'DVD_Overlay')
|
|
184
|
+
|
|
185
|
+
yaml_file = File.expand_path('release_mappings.yaml', @distro_build_dir)
|
|
186
|
+
|
|
187
|
+
tar_file = File.join(overlay_dir, "SIMP-#{@simp_version}-#{distro}-#{version}-#{arch}.tar.gz")
|
|
188
|
+
|
|
189
|
+
$simp6_clean_dirs << output_dir
|
|
190
|
+
$simp6_clean_dirs << staging_dir
|
|
191
|
+
$simp6_clean_dirs << overlay_dir
|
|
192
|
+
|
|
193
|
+
if File.exist?(tar_file)
|
|
194
|
+
if prompt
|
|
195
|
+
valid_entry = false
|
|
196
|
+
until valid_entry
|
|
197
|
+
puts("Existing tar file found at #{tar_file}")
|
|
198
|
+
print('Do you want to overwrite it? (y|N): ')
|
|
199
|
+
|
|
200
|
+
resp = $stdin.gets.chomp
|
|
201
|
+
|
|
202
|
+
if resp.empty? || (resp =~ %r{^(n|N)})
|
|
224
203
|
tarball = tar_file
|
|
204
|
+
valid_entry = true
|
|
205
|
+
elsif %r{^(y|Y)}.match?(resp)
|
|
206
|
+
tarball = false
|
|
207
|
+
valid_entry = true
|
|
208
|
+
|
|
209
|
+
if verbose
|
|
210
|
+
warn("Notice: Overwriting existing tarball at #{tar_file}")
|
|
211
|
+
warn('Notice: PRESS CTRL-C WITHIN 5 SECONDS TO CANCEL')
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
sleep(5)
|
|
215
|
+
else
|
|
216
|
+
puts("Invalid input: '#{resp}', please try again")
|
|
225
217
|
end
|
|
226
218
|
end
|
|
219
|
+
else
|
|
220
|
+
unless build_overlay
|
|
221
|
+
tarball = tar_file
|
|
222
|
+
end
|
|
227
223
|
end
|
|
224
|
+
end
|
|
228
225
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
226
|
+
if tarball
|
|
227
|
+
do_docs = false
|
|
228
|
+
do_checkout = false
|
|
229
|
+
do_bundle = false
|
|
230
|
+
end
|
|
234
231
|
|
|
235
|
-
|
|
236
|
-
|
|
232
|
+
@dirty_repos = nil
|
|
233
|
+
@simp_output_iso = nil
|
|
237
234
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
235
|
+
# Build environment sanity checks
|
|
236
|
+
# --------------------
|
|
237
|
+
if do_rm_staging && !do_unpack
|
|
238
|
+
raise SIMPBuildException, 'ERROR: Mixing `SIMP_BUILD_rm_staging_dir=yes` and `SIMP_BUILD_unpack=no` is silly.'
|
|
239
|
+
end
|
|
243
240
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
241
|
+
if File.exist?(output_dir) && !File.directory?(output_dir)
|
|
242
|
+
raise SIMPBuildException, "ERROR: ISO output dir exists but is not a directory:\n\n " \
|
|
243
|
+
"'#{output_dir}'\n\n"
|
|
244
|
+
end
|
|
248
245
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
246
|
+
unless File.directory?(output_dir)
|
|
247
|
+
FileUtils.mkdir_p(output_dir)
|
|
248
|
+
end
|
|
252
249
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
# check out subrepos
|
|
258
|
-
# --------------------
|
|
259
|
-
if do_checkout && !tarball
|
|
260
|
-
puts
|
|
261
|
-
puts '='*80
|
|
262
|
-
puts "## Checking out subrepositories"
|
|
263
|
-
puts
|
|
264
|
-
puts " (skip with `SIMP_BUILD_checkout=no`)"
|
|
265
|
-
puts '='*80
|
|
266
|
-
|
|
267
|
-
Dir.chdir repo_root_dir
|
|
268
|
-
Rake::Task['deps:status'].reenable
|
|
269
|
-
Rake::Task['deps:status'].invoke
|
|
270
|
-
|
|
271
|
-
if @dirty_repos && !ENV['SIMP_BUILD_force_dirty'] == 'yes'
|
|
272
|
-
raise SIMPBuildException, "ERROR: Dirty repos detected! I refuse to destroy uncommitted work."
|
|
273
|
-
else
|
|
274
|
-
puts
|
|
275
|
-
puts '-'*80
|
|
276
|
-
puts "#### Checking out subrepositories using method '#{method}'"
|
|
277
|
-
puts '-'*80
|
|
278
|
-
Rake::Task['deps:checkout'].reenable
|
|
279
|
-
Rake::Task['deps:checkout'].invoke(method)
|
|
280
|
-
end
|
|
250
|
+
# Look up ISOs against known build assets
|
|
251
|
+
# --------------------
|
|
252
|
+
target_data = get_target_data(target_release, iso_paths, yaml_file, do_checksum, verbose)
|
|
281
253
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
254
|
+
# check out subrepos
|
|
255
|
+
# --------------------
|
|
256
|
+
puts
|
|
257
|
+
puts '=' * 80
|
|
258
|
+
if do_checkout && !tarball
|
|
259
|
+
puts '## Checking out subrepositories'
|
|
260
|
+
puts
|
|
261
|
+
puts ' (skip with `SIMP_BUILD_checkout=no`)'
|
|
262
|
+
puts '=' * 80
|
|
263
|
+
|
|
264
|
+
Dir.chdir repo_root_dir
|
|
265
|
+
Rake::Task['deps:status'].reenable
|
|
266
|
+
Rake::Task['deps:status'].invoke
|
|
267
|
+
|
|
268
|
+
raise SIMPBuildException, 'ERROR: Dirty repos detected! I refuse to destroy uncommitted work.' if @dirty_repos && !ENV['SIMP_BUILD_force_dirty'] == 'yes'
|
|
269
|
+
|
|
270
|
+
puts
|
|
271
|
+
puts '-' * 80
|
|
272
|
+
puts "#### Checking out subrepositories using method '#{method}'"
|
|
273
|
+
puts '-' * 80
|
|
274
|
+
Rake::Task['deps:checkout'].reenable
|
|
275
|
+
Rake::Task['deps:checkout'].invoke(method)
|
|
276
|
+
|
|
277
|
+
puts
|
|
278
|
+
puts '-' * 80
|
|
279
|
+
if do_bundle
|
|
280
|
+
puts '#### Running bundler in all repos'
|
|
281
|
+
puts ' (Disable with `SIMP_BUILD_bundle=no`)'
|
|
282
|
+
puts '-' * 80
|
|
283
|
+
Rake::Task['build:bundle'].reenable
|
|
284
|
+
Rake::Task['build:bundle'].invoke
|
|
297
285
|
else
|
|
298
|
-
puts
|
|
299
|
-
puts '='
|
|
300
|
-
puts
|
|
301
|
-
puts
|
|
286
|
+
puts '#### SKIPPED: bundler in all repos'
|
|
287
|
+
puts ' (Force with `SIMP_BUILD_bundle=yes`)'
|
|
288
|
+
puts '-' * 80
|
|
302
289
|
end
|
|
290
|
+
else
|
|
291
|
+
puts '#### skipping sub repository checkout (because `SIMP_BUILD_checkout=no`)'
|
|
292
|
+
puts
|
|
293
|
+
end
|
|
303
294
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
295
|
+
# build tarball
|
|
296
|
+
# --------------------
|
|
297
|
+
puts
|
|
298
|
+
if tarball
|
|
299
|
+
puts '-' * 80
|
|
300
|
+
puts '#### Using pre-existing tarball:'
|
|
301
|
+
puts " '#{tarball}'"
|
|
302
|
+
puts
|
|
303
|
+
puts '-' * 80
|
|
313
304
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
puts '='*80
|
|
305
|
+
else
|
|
306
|
+
puts '=' * 80
|
|
307
|
+
puts '#### Running tar:build'
|
|
308
|
+
puts '=' * 80
|
|
319
309
|
|
|
320
|
-
|
|
321
|
-
|
|
310
|
+
# Horrible state passing magic vars
|
|
311
|
+
$tarball_tgt = File.join(@distro_build_dir, 'DVD_Overlay', "SIMP-#{@simp_version}-#{distro}-#{version}-#{arch}.tar.gz")
|
|
322
312
|
|
|
323
|
-
|
|
324
|
-
|
|
313
|
+
Rake::Task['tar:build'].reenable
|
|
314
|
+
Rake::Task['tar:build'].invoke(key_name, do_docs)
|
|
325
315
|
|
|
326
|
-
|
|
327
|
-
|
|
316
|
+
tarball = $tarball_tgt
|
|
317
|
+
end
|
|
328
318
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
# If you have previously downloaded packages from yum, you may need to run
|
|
339
|
-
# $ rake build:yum:clean_cache
|
|
340
|
-
|
|
341
|
-
# Optionally, you may drop in custom packages you wish to have available during an install into build/yum_data/SIMP<simp_version>_<CentOS or RHEL><os_version>_<architecture>/packages
|
|
342
|
-
# TODO: ENV var for optional packages
|
|
343
|
-
|
|
344
|
-
prepare_staging_dir( staging_dir, do_rm_staging, repo_root_dir, verbose )
|
|
345
|
-
Dir.chdir staging_dir
|
|
346
|
-
|
|
347
|
-
#
|
|
348
|
-
# --------------------
|
|
349
|
-
if do_unpack
|
|
350
|
-
puts
|
|
351
|
-
puts '='*80
|
|
352
|
-
puts "#### unpack ISOs into staging directory"
|
|
353
|
-
puts " staging area: '#{staging_dir}'"
|
|
354
|
-
puts
|
|
355
|
-
puts " (skip with `SIMP_BUILD_unpack=no`)"
|
|
356
|
-
puts '='*80
|
|
357
|
-
puts
|
|
358
|
-
|
|
359
|
-
Dir.glob( File.join(staging_dir, "#{target_data['flavor']}*/") ).each do |f|
|
|
360
|
-
FileUtils.rm_f( f , :verbose => verbose )
|
|
361
|
-
end
|
|
319
|
+
# yum sync
|
|
320
|
+
# --------------------
|
|
321
|
+
puts
|
|
322
|
+
puts '-' * 80
|
|
323
|
+
puts "#### rake build:yum:sync[#{target_data['flavor']},#{target_data['os_version']}]"
|
|
324
|
+
puts '-' * 80
|
|
325
|
+
Rake::Task['build:yum:sync'].reenable
|
|
326
|
+
Rake::Task['build:yum:sync'].invoke(target_data['flavor'], target_data['os_version'])
|
|
362
327
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
else
|
|
369
|
-
puts
|
|
370
|
-
puts '='*80
|
|
371
|
-
puts "#### skipping ISOs unpack (because `SIMP_BUILD_unpack=no`)"
|
|
372
|
-
puts
|
|
373
|
-
end
|
|
328
|
+
# If you have previously downloaded packages from yum, you may need to run
|
|
329
|
+
# $ rake build:yum:clean_cache
|
|
330
|
+
|
|
331
|
+
# Optionally, you may drop in custom packages you wish to have available during an install into build/yum_data/SIMP<simp_version>_<CentOS or RHEL><os_version>_<architecture>/packages
|
|
332
|
+
# TODO: ENV var for optional packages
|
|
374
333
|
|
|
375
|
-
|
|
334
|
+
prepare_staging_dir(staging_dir, do_rm_staging, repo_root_dir, verbose)
|
|
335
|
+
Dir.chdir staging_dir
|
|
376
336
|
|
|
337
|
+
#
|
|
338
|
+
# --------------------
|
|
339
|
+
puts
|
|
340
|
+
puts '=' * 80
|
|
341
|
+
if do_unpack
|
|
342
|
+
puts '#### unpack ISOs into staging directory'
|
|
343
|
+
puts " staging area: '#{staging_dir}'"
|
|
377
344
|
puts
|
|
378
|
-
puts '='
|
|
379
|
-
puts
|
|
380
|
-
puts '='*80
|
|
345
|
+
puts ' (skip with `SIMP_BUILD_unpack=no`)'
|
|
346
|
+
puts '=' * 80
|
|
381
347
|
puts
|
|
382
348
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
Rake::Task['iso:build'].reenable
|
|
386
|
-
Rake::Task['iso:build'].invoke(tarball,staging_dir,do_prune)
|
|
387
|
-
|
|
388
|
-
_isos = Dir[ File.join(staging_dir, 'SIMP-*.iso') ]
|
|
389
|
-
if _isos.size == 0
|
|
390
|
-
fail "ERROR: No SIMP ISOs found in '#{staging_dir}'"
|
|
391
|
-
elsif _isos.size > 1
|
|
392
|
-
warn "WARNING: More than one SIMP ISO found in '#{staging_dir}'"
|
|
393
|
-
_isos.each{ |i| warn i }
|
|
394
|
-
end
|
|
395
|
-
|
|
396
|
-
# NOTE: It is possible at this point (given the right
|
|
397
|
-
# `SIMP_BUILD_xxx=no` flags) that iso:build will not have set
|
|
398
|
-
# `@simp_output_iso`. In that case, look at the ISOs in the staging
|
|
399
|
-
# dir (there should only be one) and take our best guess.
|
|
400
|
-
if @simp_output_iso.nil?
|
|
401
|
-
@simp_output_iso = File.basename(_isos.first)
|
|
349
|
+
Dir.glob(File.join(staging_dir, "#{target_data['flavor']}*/")).each do |f|
|
|
350
|
+
FileUtils.rm_f(f, :verbose => verbose)
|
|
402
351
|
end
|
|
403
352
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
353
|
+
target_data['isos'].each do |iso|
|
|
354
|
+
puts "---- rake unpack[#{iso},#{do_merge},#{Dir.pwd},isoinfo,#{target_data['os_version']}#{reposync_only}]"
|
|
355
|
+
Rake::Task['unpack'].reenable
|
|
356
|
+
Rake::Task['unpack'].invoke(iso, do_merge, Dir.pwd, 'isoinfo', target_data['os_version'], reposync_only)
|
|
407
357
|
end
|
|
408
|
-
|
|
409
|
-
puts
|
|
410
|
-
puts '='*80
|
|
411
|
-
puts "#### Moving '#{@simp_output_iso}' into:"
|
|
412
|
-
puts " '#{output_dir}/#{output_file}'"
|
|
413
|
-
puts '='*80
|
|
358
|
+
else
|
|
359
|
+
puts '#### skipping ISOs unpack (because `SIMP_BUILD_unpack=no`)'
|
|
414
360
|
puts
|
|
361
|
+
end
|
|
415
362
|
|
|
416
|
-
|
|
417
|
-
FileUtils.mkdir_p File.dirname(iso), :verbose => verbose
|
|
418
|
-
FileUtils.mv(@simp_output_iso, iso, :verbose => verbose)
|
|
363
|
+
Dir.chdir staging_dir
|
|
419
364
|
|
|
420
|
-
|
|
421
|
-
|
|
365
|
+
puts
|
|
366
|
+
puts '=' * 80
|
|
367
|
+
puts "#### iso:build[#{tarball}, #{staging_dir}, #{do_prune}]"
|
|
368
|
+
puts '=' * 80
|
|
369
|
+
puts
|
|
422
370
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
371
|
+
ENV['SIMP_ISO_verbose'] = 'yes' if verbose
|
|
372
|
+
ENV['SIMP_PKG_verbose'] = 'yes' if verbose
|
|
373
|
+
Rake::Task['iso:build'].reenable
|
|
374
|
+
Rake::Task['iso:build'].invoke(tarball, staging_dir, do_prune)
|
|
375
|
+
|
|
376
|
+
_isos = Dir[File.join(staging_dir, 'SIMP-*.iso')]
|
|
377
|
+
if _isos.empty?
|
|
378
|
+
raise "ERROR: No SIMP ISOs found in '#{staging_dir}'"
|
|
379
|
+
elsif _isos.size > 1
|
|
380
|
+
warn "WARNING: More than one SIMP ISO found in '#{staging_dir}'"
|
|
381
|
+
_isos.each { |i| warn i }
|
|
382
|
+
end
|
|
428
383
|
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
384
|
+
# NOTE: It is possible at this point (given the right
|
|
385
|
+
# `SIMP_BUILD_xxx=no` flags) that iso:build will not have set
|
|
386
|
+
# `@simp_output_iso`. In that case, look at the ISOs in the staging
|
|
387
|
+
# dir (there should only be one) and take our best guess.
|
|
388
|
+
if @simp_output_iso.nil?
|
|
389
|
+
@simp_output_iso = File.basename(_isos.first)
|
|
390
|
+
end
|
|
432
391
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
'error' => e.to_s,
|
|
437
|
-
'backtrace' => e.backtrace
|
|
438
|
-
}
|
|
392
|
+
output_file = full_iso_name || @simp_output_iso
|
|
393
|
+
if iso_name_tag
|
|
394
|
+
output_file = output_file.sub(%r{\.iso$}i, "__#{iso_name_tag}.iso")
|
|
439
395
|
end
|
|
440
396
|
|
|
441
|
-
|
|
442
|
-
|
|
397
|
+
puts
|
|
398
|
+
puts '=' * 80
|
|
399
|
+
puts "#### Moving '#{@simp_output_iso}' into:"
|
|
400
|
+
puts " '#{output_dir}/#{output_file}'"
|
|
401
|
+
puts '=' * 80
|
|
402
|
+
puts
|
|
443
403
|
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
else
|
|
448
|
-
failed_isos << iso
|
|
449
|
-
end
|
|
450
|
-
end
|
|
404
|
+
iso = File.join(output_dir, output_file)
|
|
405
|
+
FileUtils.mkdir_p File.dirname(iso), :verbose => verbose
|
|
406
|
+
FileUtils.mv(@simp_output_iso, iso, :verbose => verbose)
|
|
451
407
|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
puts '='*80
|
|
455
|
-
puts("Successful ISOs:")
|
|
456
|
-
puts(%( * #{successful_isos.join("\n * ")}))
|
|
457
|
-
end
|
|
408
|
+
var_json = Simp::Packer::IsoVarsJson.new(iso, target_release, target_data, {})
|
|
409
|
+
var_json.write
|
|
458
410
|
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
puts(%( * Error: #{iso_status[iso]['error']}))
|
|
465
|
-
|
|
466
|
-
if verbose
|
|
467
|
-
puts(%( * Backtrace: #{iso_status[iso]['backtrace'].join("\n")}))
|
|
468
|
-
else
|
|
469
|
-
puts(%( * Context: #{iso_status[iso]['backtrace'].first}))
|
|
470
|
-
end
|
|
471
|
-
end
|
|
411
|
+
puts
|
|
412
|
+
puts '=' * 80
|
|
413
|
+
puts '#### FINIS!'
|
|
414
|
+
puts '=' * 80
|
|
415
|
+
puts
|
|
472
416
|
|
|
473
|
-
|
|
474
|
-
|
|
417
|
+
iso_status[[distro, version, arch].join(' ')] = {
|
|
418
|
+
'success' => true
|
|
419
|
+
}
|
|
420
|
+
rescue StandardError => e
|
|
421
|
+
iso_status[[distro, version, arch].join(' ')] = {
|
|
422
|
+
'success' => false,
|
|
423
|
+
'error' => e.to_s,
|
|
424
|
+
'backtrace' => e.backtrace
|
|
425
|
+
}
|
|
475
426
|
end
|
|
476
|
-
end
|
|
477
427
|
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
puts "## validating ISOs for target:"
|
|
481
|
-
puts " '#{target_release}' in '#{iso_paths}'"
|
|
482
|
-
puts '='*80
|
|
483
|
-
puts
|
|
428
|
+
successful_isos = []
|
|
429
|
+
failed_isos = []
|
|
484
430
|
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
puts ''
|
|
492
|
-
puts " target release: '#{target_release}'"
|
|
493
|
-
puts " target flavor: '#{target_data['flavor']}'"
|
|
494
|
-
puts " source isos:"
|
|
495
|
-
target_data['isos'].each do |iso|
|
|
496
|
-
puts " - #{iso}"
|
|
431
|
+
iso_status.each_key do |iso|
|
|
432
|
+
if iso_status[iso]['success']
|
|
433
|
+
successful_isos << iso
|
|
434
|
+
else
|
|
435
|
+
failed_isos << iso
|
|
436
|
+
end
|
|
497
437
|
end
|
|
498
|
-
puts '-'*80
|
|
499
|
-
puts
|
|
500
|
-
sleep 3
|
|
501
438
|
|
|
502
|
-
|
|
503
|
-
|
|
439
|
+
unless successful_isos.empty?
|
|
440
|
+
puts '=' * 80
|
|
441
|
+
puts '=' * 80
|
|
442
|
+
puts('Successful ISOs:')
|
|
443
|
+
puts(%( * #{successful_isos.join("\n * ")}))
|
|
444
|
+
end
|
|
504
445
|
|
|
446
|
+
unless failed_isos.empty?
|
|
447
|
+
puts '=' * 80
|
|
448
|
+
puts('Failed ISOs:')
|
|
449
|
+
failed_isos.each do |iso|
|
|
450
|
+
puts(%( * #{iso}))
|
|
451
|
+
puts(%( * Error: #{iso_status[iso]['error']}))
|
|
505
452
|
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
end
|
|
453
|
+
if verbose
|
|
454
|
+
puts(%( * Backtrace: #{iso_status[iso]['backtrace'].join("\n")}))
|
|
455
|
+
else
|
|
456
|
+
puts(%( * Context: #{iso_status[iso]['backtrace'].first}))
|
|
457
|
+
end
|
|
458
|
+
end
|
|
513
459
|
|
|
514
|
-
|
|
515
|
-
puts
|
|
516
|
-
puts '-'*80
|
|
517
|
-
puts '#### Ensuring previous staging directory is removed:'
|
|
518
|
-
puts " '#{staging_dir}'"
|
|
519
|
-
puts
|
|
520
|
-
puts ' (disable this with `SIMP_BUILD_rm_staging_dir=no`)'
|
|
521
|
-
puts '-'*80
|
|
522
|
-
|
|
523
|
-
FileUtils.rm_rf staging_dir, :verbose => verbose
|
|
524
|
-
elsif File.exist? staging_dir
|
|
525
|
-
warn ''
|
|
526
|
-
warn '!'*80
|
|
527
|
-
warn '#### WARNING: staging dir already exists at:'
|
|
528
|
-
warn " '#{staging_dir}'"
|
|
529
|
-
warn ''
|
|
530
|
-
warn ' - Previously staged assets in this directory may cause problems.'
|
|
531
|
-
warn ' - Use `SIMP_BUILD_rm_staging_dir=yes` to remove it automatically.'
|
|
532
|
-
warn ''
|
|
533
|
-
warn '!'*80
|
|
534
|
-
warn ''
|
|
535
|
-
sleep 10
|
|
460
|
+
exit(1)
|
|
536
461
|
end
|
|
537
|
-
FileUtils.mkdir_p staging_dir, :verbose => verbose
|
|
538
462
|
end
|
|
463
|
+
end
|
|
464
|
+
|
|
465
|
+
def get_target_data(target_release, iso_paths, yaml_file, do_checksum, verbose)
|
|
466
|
+
puts '=' * 80
|
|
467
|
+
puts '## validating ISOs for target:'
|
|
468
|
+
puts " '#{target_release}' in '#{iso_paths}'"
|
|
469
|
+
puts '=' * 80
|
|
470
|
+
puts
|
|
471
|
+
|
|
472
|
+
mapper = Simp::Build::ReleaseMapper.new(target_release, yaml_file, do_checksum == 'true')
|
|
473
|
+
mapper.verbose = true || verbose
|
|
474
|
+
target_data = mapper.autoscan_unpack_list(iso_paths)
|
|
475
|
+
|
|
476
|
+
puts '-' * 80
|
|
477
|
+
puts '## target data:'
|
|
478
|
+
puts ''
|
|
479
|
+
puts " target release: '#{target_release}'"
|
|
480
|
+
puts " target flavor: '#{target_data['flavor']}'"
|
|
481
|
+
puts ' source isos:'
|
|
482
|
+
target_data['isos'].each do |iso|
|
|
483
|
+
puts " - #{iso}"
|
|
484
|
+
end
|
|
485
|
+
puts '-' * 80
|
|
486
|
+
puts
|
|
487
|
+
sleep 3
|
|
488
|
+
|
|
489
|
+
target_data
|
|
490
|
+
end
|
|
539
491
|
|
|
492
|
+
def prepare_staging_dir(staging_dir, do_rm_staging, repo_root_dir, verbose)
|
|
493
|
+
if ['', '/', Dir.home, repo_root_dir].include? staging_dir
|
|
494
|
+
raise SIMPBuildException,
|
|
495
|
+
"ERROR: staging directoy path is too stupid to be believed:\n " \
|
|
496
|
+
"'#{staging_dir}'\n\n " \
|
|
497
|
+
"Use SIMP_BUILD_staging_dir='path/to/staging/dir'\n\n"
|
|
498
|
+
end
|
|
540
499
|
|
|
500
|
+
if do_rm_staging
|
|
501
|
+
puts
|
|
502
|
+
puts '-' * 80
|
|
503
|
+
puts '#### Ensuring previous staging directory is removed:'
|
|
504
|
+
puts " '#{staging_dir}'"
|
|
505
|
+
puts
|
|
506
|
+
puts ' (disable this with `SIMP_BUILD_rm_staging_dir=no`)'
|
|
507
|
+
puts '-' * 80
|
|
508
|
+
|
|
509
|
+
FileUtils.rm_rf staging_dir, :verbose => verbose
|
|
510
|
+
elsif File.exist? staging_dir
|
|
511
|
+
warn ''
|
|
512
|
+
warn '!' * 80
|
|
513
|
+
warn '#### WARNING: staging dir already exists at:'
|
|
514
|
+
warn " '#{staging_dir}'"
|
|
515
|
+
warn ''
|
|
516
|
+
warn ' - Previously staged assets in this directory may cause problems.'
|
|
517
|
+
warn ' - Use `SIMP_BUILD_rm_staging_dir=yes` to remove it automatically.'
|
|
518
|
+
warn ''
|
|
519
|
+
warn '!' * 80
|
|
520
|
+
warn ''
|
|
521
|
+
sleep 10
|
|
522
|
+
end
|
|
523
|
+
FileUtils.mkdir_p staging_dir, :verbose => verbose
|
|
541
524
|
end
|
|
542
525
|
end
|
|
543
526
|
end
|