From d08f65bfeae4b274928701d3171d4348cbbef9fa Mon Sep 17 00:00:00 2001 From: Benjamin Karran Date: Wed, 13 Jul 2022 10:23:22 +0200 Subject: [PATCH 1/2] Forward exit code for build command Signed-off-by: Benjamin Karran --- podman_compose.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/podman_compose.py b/podman_compose.py index fe921653..31a156e2 100755 --- a/podman_compose.py +++ b/podman_compose.py @@ -1919,7 +1919,9 @@ def build_one(compose, args, cnt): ) ) build_args.append(ctx) - compose.podman.run([], "build", build_args, sleep=0) + exit_code = compose.podman.run([], "build", build_args, sleep=0).wait() + if 0 != exit_code: + sys.exit(exit_code) @cmd_run(podman_compose, "build", "build stack images") From e18e6816512459006de584c298570d266c5b9a31 Mon Sep 17 00:00:00 2001 From: Benjamin Karran Date: Wed, 13 Jul 2022 10:34:10 +0200 Subject: [PATCH 2/2] Forward exit code for push command Signed-off-by: Benjamin Karran --- podman_compose.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/podman_compose.py b/podman_compose.py index 31a156e2..3674fa17 100755 --- a/podman_compose.py +++ b/podman_compose.py @@ -1863,7 +1863,9 @@ def compose_push(compose, args): continue if services and cnt["_service"] not in services: continue - compose.podman.run([], "push", [cnt["image"]], sleep=0) + exit_code = compose.podman.run([], "push", [cnt["image"]], sleep=0).wait() + if (not getattr(args, "ignore_push_failures", None)) and 0 != exit_code: + sys.exit(exit_code) def build_one(compose, args, cnt): @@ -2673,7 +2675,7 @@ def compose_push_parse(parser): parser.add_argument( "--ignore-push-failures", action="store_true", - help="Push what it can and ignores images with push failures. (not implemented)", + help="Push what it can and ignores images with push failures.", ) parser.add_argument( "services", metavar="services", nargs="*", help="services to push"