Skip to content

Commit d651252

Browse files
committed
fix
1 parent 3029096 commit d651252

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

tools/core/image.py

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -266,18 +266,25 @@ def push(self, platform: Platform, no_cache: bool = False, dirty_push: bool = Fa
266266

267267
tag = self.get_build_tag(self.branch, platform)
268268

269-
print("Push {}".format(tag))
269+
print()
270+
print("=" * 80)
271+
print("Pushing {}".format(tag))
272+
print("=" * 80)
273+
274+
sys.stdout.flush()
270275

271276
cmd = "docker push {}".format(tag)
277+
print("\033[1m$ %s\033[0m".format(cmd), flush=True)
272278
output = execute(cmd)
273-
self._logger.debug("$ %s\n%s", cmd, output)
279+
print("%s" % output.rstrip(), flush=True)
274280
last_line = output.splitlines()[-1]
275281
p = re.compile(r"^(.*): digest: (.*) size: (\d+)$")
276282
m = p.match(last_line)
277283
assert m
278284
assert m.group(1) in tag
279285

280286
new_manifest = "{}/{}@{}".format(self.group, self.name, m.group(2))
287+
print("New manifest: %s" % new_manifest, flush=True)
281288

282289
# append to manifest list
283290
os.environ["DOCKER_CLI_EXPERIMENTAL"] = "enabled"
@@ -293,22 +300,28 @@ def push(self, platform: Platform, no_cache: bool = False, dirty_push: bool = Fa
293300
tags.append("{}@{}".format(repo, m.digest))
294301
tags = " ".join(tags)
295302
cmd = f"docker manifest create {t0} {new_manifest}"
303+
296304
if len(tags) > 0:
297305
cmd += " " + tags
298-
output = execute(cmd)
299-
self._logger.debug("$ %s\n%s", cmd, output)
306+
print("\033[1m$ %s\033[0m".format(cmd), flush=True)
307+
if os.system(cmd) != 0:
308+
raise Exception("Failed to create manifest")
300309

301310
cmd = f"docker manifest push -p {t0}"
302-
output = execute(cmd)
303-
self._logger.debug("$ %s\n%s", cmd, output)
311+
print("\033[1m$ %s\033[0m".format(cmd), flush=True)
312+
if os.system(cmd) != 0:
313+
raise Exception("Failed to push manifest")
314+
304315
else:
305316
cmd = f"docker manifest create {t0} {new_manifest}"
306-
output = execute(cmd)
307-
self._logger.debug("$ %s\n%s", cmd, output)
317+
print("\033[1m$ %s\033[0m".format(cmd), flush=True)
318+
if os.system(cmd) != 0:
319+
raise Exception("Failed to create manifest")
308320

309321
cmd = f"docker manifest push -p {t0}"
310-
output = execute(cmd)
311-
self._logger.debug("$ %s\n%s", cmd, output)
322+
print("\033[1m$ %s\033[0m".format(cmd), flush=True)
323+
if os.system(cmd) != 0:
324+
raise Exception("Failed to push manifest")
312325

313326
def __repr__(self):
314327
return "<Image name=%r tag=%r branch=%r>" % (self.name, self.tag, self.branch)

0 commit comments

Comments
 (0)