From abfb1c6404cba2fc63bc6cec47267b667adb6259 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Sat, 3 Apr 2021 20:22:53 +0200 Subject: [PATCH] Support multiple compose files for app json generation Closes https://git.autonomic.zone/coop-cloud/abra/issues/127. --- bin/app-json.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/app-json.py b/bin/app-json.py index 27d31e5..b053033 100755 --- a/bin/app-json.py +++ b/bin/app-json.py @@ -159,8 +159,12 @@ def get_app_versions(app_path): services_cmd = "yq e '.services | keys | .[]' compose*.yml" services = _run_cmd(services_cmd, shell=True).split() + parsed_services = [] service_versions = {} for service in services: + if service in parsed_services: + continue + services_cmd = f"yq e '.services.{service}.image' compose*.yml" images = _run_cmd(services_cmd, shell=True).split() @@ -180,6 +184,8 @@ def get_app_versions(app_path): log.info(f"Parsed {service_version_info}") service_versions[service] = service_version_info + parsed_services.append(service) + versions[tag] = service_versions _run_cmd("git checkout HEAD")