Buildah: support push arg

This commit is contained in:
jpic 2020-02-16 14:47:03 +01:00
parent 9736c1bb2b
commit e0c902eb47

View File

@ -169,9 +169,7 @@ class Buildah(Localhost):
await self.exec('podman', 'push', f'{self.image.repository}:{tag}', buildah=False) await self.exec('podman', 'push', f'{self.image.repository}:{tag}', buildah=False)
async def clean(self, *args, **kwargs): async def clean(self, *args, **kwargs):
if self.is_wrapper(): if not self.is_wrapper():
return
for src, dst in self.mounts.items(): for src, dst in self.mounts.items():
await self.exec('umount', self.mnt / str(dst)[1:], buildah=False) await self.exec('umount', self.mnt / str(dst)[1:], buildah=False)
@ -183,3 +181,7 @@ class Buildah(Localhost):
if self.ctr is not None: if self.ctr is not None:
await self.exec('buildah', 'rm', self.ctr, buildah=False) await self.exec('buildah', 'rm', self.ctr, buildah=False)
if 'push' in args:
for tag in self.image.tags:
await self.exec('podman', 'push', f'{self.image.repository}:{tag}', buildah=False)