From 9a08f85ffd08d84796af5e9d104c0b83c5490d81 Mon Sep 17 00:00:00 2001 From: Roman Blanco Date: Wed, 9 Nov 2022 09:33:40 +0000 Subject: [PATCH] FIXES #586: preserve exit code for podman-compose build Signed-off-by: Roman Blanco --- podman_compose.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/podman_compose.py b/podman_compose.py index 2c1e56e..ba7271e 100755 --- a/podman_compose.py +++ b/podman_compose.py @@ -2002,7 +2002,8 @@ def build_one(compose, args, cnt): ) ) build_args.append(ctx) - compose.podman.run([], "build", build_args, sleep=0) + status = compose.podman.run([], "build", build_args, sleep=0) + return status @cmd_run(podman_compose, "build", "build stack images") @@ -2012,10 +2013,12 @@ def compose_build(compose, args): compose.assert_services(args.services) for service in args.services: cnt = compose.container_by_name[container_names_by_service[service][0]] - build_one(compose, args, cnt) + p = build_one(compose, args, cnt) + exit(p.returncode) else: for cnt in compose.containers: - build_one(compose, args, cnt) + p = build_one(compose, args, cnt) + exit(p.returncode) def create_pods(compose, args): # pylint: disable=unused-argument