forked from sig_core/toolkit
make the rootfs tarball the main artifact for Containers
This commit is contained in:
parent
85a28fa8fb
commit
aa89ed109b
@ -130,6 +130,10 @@ class KiwiBackend(BackendInterface):
|
|||||||
source = utils.remove_first_directory(source)
|
source = utils.remove_first_directory(source)
|
||||||
dest = f"{self.ctx.outdir}/{self.ctx.outname}.{filetype}"
|
dest = f"{self.ctx.outdir}/{self.ctx.outname}.{filetype}"
|
||||||
|
|
||||||
|
# NOTE(neil): only because we are preparing the 'final' image in clean step...
|
||||||
|
if self.ctx.image_type == 'Container':
|
||||||
|
dest = f"{self.ctx.outdir}/{self.ctx.outname}.oci"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
shutil.move(source, dest)
|
shutil.move(source, dest)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@ -145,6 +149,15 @@ class KiwiBackend(BackendInterface):
|
|||||||
raise e
|
raise e
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
|
# TODO(neil): refactor
|
||||||
|
if self.ctx.image_type == 'Container':
|
||||||
|
# need to do this before we remove it, otherwise we have to extract from the OCI tarball
|
||||||
|
root = f"/builddir{self.ctx.outdir}"
|
||||||
|
builddir = f"{root}/build/image-root"
|
||||||
|
ret, out, err = self.run_mock_command(["--shell", "--", "tar", "-C", builddir, "-cJf", f"{root}/{self.ctx.outname}.tar.xz", "."])
|
||||||
|
if ret > 0:
|
||||||
|
raise Exception(err)
|
||||||
|
|
||||||
ret, out, err = self.run_mock_command(["--shell", "rm", "-fr", f"/builddir/{self.ctx.outdir}/build/"])
|
ret, out, err = self.run_mock_command(["--shell", "rm", "-fr", f"/builddir/{self.ctx.outdir}/build/"])
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user