symlink logs to result dir
This commit is contained in:
parent
0372a8e6a4
commit
ebf892a1c0
2 changed files with 14 additions and 10 deletions
|
|
@ -436,10 +436,8 @@ class BuildRoot(object):
|
||||||
with koji._open_text_file(self.rootdir() + destfile, 'wt') as fo:
|
with koji._open_text_file(self.rootdir() + destfile, 'wt') as fo:
|
||||||
fo.write(settings)
|
fo.write(settings)
|
||||||
|
|
||||||
def mock(self, args, additional_logs=None):
|
def mock(self, args):
|
||||||
"""Run mock"""
|
"""Run mock"""
|
||||||
if additional_logs is None:
|
|
||||||
additional_logs = {}
|
|
||||||
mockpath = getattr(self.options, "mockpath", "/usr/bin/mock")
|
mockpath = getattr(self.options, "mockpath", "/usr/bin/mock")
|
||||||
cmd = [mockpath, "-r", self.mockcfg]
|
cmd = [mockpath, "-r", self.mockcfg]
|
||||||
# if self.options.debug_mock:
|
# if self.options.debug_mock:
|
||||||
|
|
@ -459,8 +457,6 @@ class BuildRoot(object):
|
||||||
resultdir = self.resultdir()
|
resultdir = self.resultdir()
|
||||||
uploadpath = self.getUploadPath()
|
uploadpath = self.getUploadPath()
|
||||||
logs = {}
|
logs = {}
|
||||||
for logname, path in additional_logs.items():
|
|
||||||
logs[logname] = (None, None, 0, path)
|
|
||||||
|
|
||||||
ts_offsets = {}
|
ts_offsets = {}
|
||||||
finished = False
|
finished = False
|
||||||
|
|
|
||||||
|
|
@ -372,8 +372,10 @@ class KiwiCreateImageTask(BaseBuildTask):
|
||||||
self.uploadFile(desc)
|
self.uploadFile(desc)
|
||||||
|
|
||||||
target_dir = '/builddir/result/image'
|
target_dir = '/builddir/result/image'
|
||||||
root_log_path = os.path.join(broot.rootdir(), target_dir[1:], "build/image-root.log")
|
os.symlink( # symlink log to resultdir, so it is incrementally uploaded
|
||||||
root_log_remote_name = f"image-root.{arch}.log"
|
os.path.join(broot.rootdir(), "/tmp/image-root.{arch}.log"),
|
||||||
|
os.path.join(broot.resultdir(), f'image-root.{arch}.log')
|
||||||
|
)
|
||||||
cmd = ['kiwi-ng']
|
cmd = ['kiwi-ng']
|
||||||
if self.opts.get('profile'):
|
if self.opts.get('profile'):
|
||||||
cmd.extend(['--profile', self.opts['profile']])
|
cmd.extend(['--profile', self.opts['profile']])
|
||||||
|
|
@ -381,18 +383,24 @@ class KiwiCreateImageTask(BaseBuildTask):
|
||||||
cmd.extend(['--type', self.opts['type']])
|
cmd.extend(['--type', self.opts['type']])
|
||||||
cmd.extend([
|
cmd.extend([
|
||||||
'--kiwi-file', os.path.basename(desc), # global option for image/system commands
|
'--kiwi-file', os.path.basename(desc), # global option for image/system commands
|
||||||
|
'--logfile', f"/tmp/image-root.{arch}.log",
|
||||||
'system', 'build',
|
'system', 'build',
|
||||||
'--description', os.path.join(os.path.basename(scmsrcdir), base_path),
|
'--description', os.path.join(os.path.basename(scmsrcdir), base_path),
|
||||||
'--target-dir', target_dir,
|
'--target-dir', target_dir,
|
||||||
])
|
])
|
||||||
rv = broot.mock(['--cwd', broot.tmpdir(within=True), '--chroot', '--'] + cmd,
|
rv = broot.mock(['--cwd', broot.tmpdir(within=True), '--chroot', '--'] + cmd)
|
||||||
additional_logs={root_log_remote_name: root_log_path})
|
|
||||||
if rv:
|
if rv:
|
||||||
raise koji.GenericError("Kiwi failed")
|
raise koji.GenericError("Kiwi failed")
|
||||||
|
|
||||||
# rename artifacts accordingly to release
|
# rename artifacts accordingly to release
|
||||||
|
os.symlink( # symlink log to resultdir, so it is incrementally uploaded
|
||||||
|
os.path.join(broot.rootdir(), "/tmp/kiwi-result-bundle.{arch}.log"),
|
||||||
|
os.path.join(broot.resultdir(), f'kiwi-result-bundle.{arch}.log')
|
||||||
|
)
|
||||||
bundle_dir = '/builddir/result/bundle'
|
bundle_dir = '/builddir/result/bundle'
|
||||||
cmd = ['kiwi-ng', 'result', 'bundle',
|
cmd = ['kiwi-ng',
|
||||||
|
'--logfile', f"/tmp/kiwi-result-bundle.{arch}.log",
|
||||||
|
'result', 'bundle',
|
||||||
'--target-dir', target_dir,
|
'--target-dir', target_dir,
|
||||||
'--bundle-dir', bundle_dir,
|
'--bundle-dir', bundle_dir,
|
||||||
'--id', release]
|
'--id', release]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue