sort logs by date

This commit is contained in:
Louis Abel 2022-06-16 12:24:19 -07:00
parent 3d161df451
commit 2ffd96ad1e
Signed by untrusted user: label
GPG Key ID: B37E62D143879B36
3 changed files with 20 additions and 16 deletions

View File

@ -13,7 +13,7 @@ lorax --product='{{ distname }}' \
--variant={{ variant }} \ --variant={{ variant }} \
--nomacboot \ --nomacboot \
--buildarch={{ arch }} \ --buildarch={{ arch }} \
--volid={{ shortname }}-{{ major }}-{{ minor }}-{{ arch }}-dvd1 \ --volid={{ shortname }}-{{ major }}-{{ minor }}{{ rc }}-{{ arch }}-boot1 \
--logfile={{ mock_work_root }}/lorax.log \ --logfile={{ mock_work_root }}/lorax.log \
--rootfs-size=3 \ --rootfs-size=3 \
{{ lorax_work_root }} {{ lorax_work_root }}

View File

@ -177,7 +177,8 @@ class RepoSync:
log_root = os.path.join( log_root = os.path.join(
work_root, work_root,
"logs" "logs",
self.date_stamp
) )
if self.dryrun: if self.dryrun:
@ -313,18 +314,16 @@ class RepoSync:
a a
)) ))
sync_log = ("{}/{}-{}-{}.log").format( sync_log = ("{}/{}-{}.log").format(
log_root, log_root,
repo_name, repo_name,
a, a
self.date_stamp
) )
debug_sync_log = ("{}/{}-{}-debug-{}.log").format( debug_sync_log = ("{}/{}-{}-debug.log").format(
log_root, log_root,
repo_name, repo_name,
a, a
self.date_stamp
) )
sync_cmd = ("/usr/bin/dnf reposync -c {}.{} --download-metadata " sync_cmd = ("/usr/bin/dnf reposync -c {}.{} --download-metadata "
@ -395,10 +394,9 @@ class RepoSync:
'source/tree' 'source/tree'
) )
source_sync_log = ("{}/{}-source-{}.log").format( source_sync_log = ("{}/{}-source.log").format(
log_root, log_root,
repo_name, repo_name
self.date_stamp
) )
source_sync_cmd = ("/usr/bin/dnf reposync -c {} " source_sync_cmd = ("/usr/bin/dnf reposync -c {} "
@ -690,7 +688,7 @@ class RepoSync:
) )
repoclosure_cmd = ('/usr/bin/dnf repoclosure {} ' repoclosure_cmd = ('/usr/bin/dnf repoclosure {} '
'--repofrompath={},file://{}/{}/{}/os --repo={} --check={} {} ' '--repofrompath={},file://{}/{}/{}/os --repo={} --check={} {} '
'| tee -a {}/{}-repoclosure-{}-{}.log').format( '| tee -a {}/{}-repoclosure-{}.log').format(
repoclosure_arch_list, repoclosure_arch_list,
repo, repo,
sync_root, sync_root,
@ -701,8 +699,7 @@ class RepoSync:
join_repo_comb, join_repo_comb,
log_root, log_root,
repo, repo,
arch, arch
self.date_stamp
) )
repoclosure_entry_point_open = open(repoclosure_entry_point_sh, "w+") repoclosure_entry_point_open = open(repoclosure_entry_point_sh, "w+")
repoclosure_entry_point_open.write('#!/bin/bash\n') repoclosure_entry_point_open.write('#!/bin/bash\n')

View File

@ -30,6 +30,7 @@ class IsoBuild:
rlvars, rlvars,
config, config,
major, major,
rc: bool = False,
isolation: str = 'auto', isolation: str = 'auto',
compose_dir_is_here: bool = False, compose_dir_is_here: bool = False,
image=None, image=None,
@ -54,11 +55,13 @@ class IsoBuild:
self.lorax_result_root = config['mock_work_root'] + "/" + "lorax" self.lorax_result_root = config['mock_work_root'] + "/" + "lorax"
self.mock_isolation = isolation self.mock_isolation = isolation
self.iso_map = rlvars['iso_map'] self.iso_map = rlvars['iso_map']
self.release_candidate = rc
# Relevant major version items # Relevant major version items
self.release = rlvars['revision'] self.release = rlvars['revision']
self.minor_version = rlvars['revision'].split('.')[1] self.minor_version = rlvars['revision'].split('.')[1]
self.revision = rlvars['revision'] + "-" + rlvars['rclvl'] self.revision = rlvars['revision'] + "-" + rlvars['rclvl']
self.rclvl = rlvars['rclvl']
self.repos = rlvars['iso_map']['repos'] self.repos = rlvars['iso_map']['repos']
self.repo_base_url = config['repo_base_url'] self.repo_base_url = config['repo_base_url']
self.project_id = rlvars['project_id'] self.project_id = rlvars['project_id']
@ -172,7 +175,6 @@ class IsoBuild:
# Check for arch specific build, build accordingly # Check for arch specific build, build accordingly
# local AND arch cannot be used together, local supersedes. print # local AND arch cannot be used together, local supersedes. print
# warning. # warning.
self.log.info('Generating ISO configuration and scripts')
self.generate_iso_scripts() self.generate_iso_scripts()
print() print()
@ -180,6 +182,7 @@ class IsoBuild:
""" """
Generates the scripts needed to be ran in the mock roots Generates the scripts needed to be ran in the mock roots
""" """
self.log.info('Generating ISO configuration and scripts')
mock_iso_template = self.tmplenv.get_template('isomock.tmpl.cfg') mock_iso_template = self.tmplenv.get_template('isomock.tmpl.cfg')
mock_sh_template = self.tmplenv.get_template('isobuild.tmpl.sh') mock_sh_template = self.tmplenv.get_template('isobuild.tmpl.sh')
iso_template = self.tmplenv.get_template('buildImage.tmpl.sh') iso_template = self.tmplenv.get_template('buildImage.tmpl.sh')
@ -188,6 +191,10 @@ class IsoBuild:
mock_sh_path = '/var/tmp/isobuild.sh' mock_sh_path = '/var/tmp/isobuild.sh'
iso_template_path = '/var/tmp/buildImage.sh' iso_template_path = '/var/tmp/buildImage.sh'
rclevel = ''
if self.release_candidate:
rclevel = '-' + self.rclvl
mock_iso_template_output = mock_iso_template.render( mock_iso_template_output = mock_iso_template.render(
arch=self.current_arch, arch=self.current_arch,
major=self.major_version, major=self.major_version,
@ -216,6 +223,7 @@ class IsoBuild:
lorax=self.iso_map['lorax_removes'], lorax=self.iso_map['lorax_removes'],
distname=self.distname, distname=self.distname,
revision=self.release, revision=self.release,
rc=rclevel,
) )
mock_iso_entry = open(mock_iso_path, "w+") mock_iso_entry = open(mock_iso_path, "w+")
@ -229,7 +237,6 @@ class IsoBuild:
iso_template_entry = open(iso_template_path, "w+") iso_template_entry = open(iso_template_path, "w+")
iso_template_entry.write(iso_template_output) iso_template_entry.write(iso_template_output)
iso_template_entry.close() iso_template_entry.close()
print()
# !!! Send help, we would prefer to do this using the productmd python # !!! Send help, we would prefer to do this using the productmd python
# !!! library. If you are reading this and you can help us, please do so! # !!! library. If you are reading this and you can help us, please do so!