This commit is contained in:
jpic
2020-02-13 04:53:09 +01:00
parent 00fa16052d
commit 6e8b2ec2a7
6 changed files with 56 additions and 38 deletions
+9 -7
View File
@@ -48,6 +48,12 @@ class Commit:
if not self.tags:
self.tags = ['latest']
# default tag for master too
if 'master' in self.tags:
self.tags.append('latest')
self.repotags = [f'{self.registry}/{self.repo}:{tag}' for tag in self.tags]
async def post_build(self, script):
self.sha = (await script.exec(
'buildah',
@@ -56,13 +62,9 @@ class Commit:
script.ctr,
)).out
if 'master' in self.tags:
self.tags.append('latest')
if self.tags:
for tag in self.tags:
await script.exec('buildah', 'tag', self.sha, self.repo,
f'{self.repo}:{tag}')
for tag in self.repotags:
await script.exec('buildah', 'tag', self.sha, self.repo, tag)
if self.push:
user = os.getenv('DOCKER_USER')
@@ -79,7 +81,7 @@ class Commit:
)
for tag in self.tags:
await script.exec('podman', 'push', f'{self.repo}:{tag}')
await script.exec('podman', 'push', tag)
await script.umount()
def __repr__(self):