Support multiple compose files for app json generation

Closes coop-cloud/abra#127.
This commit is contained in:
decentral1se 2021-04-03 20:22:53 +02:00
parent 0369a18c6e
commit abfb1c6404
Signed by untrusted user who does not match committer: decentral1se
GPG Key ID: 92DAD76BD9567B8A

View File

@ -159,8 +159,12 @@ def get_app_versions(app_path):
services_cmd = "yq e '.services | keys | .[]' compose*.yml" services_cmd = "yq e '.services | keys | .[]' compose*.yml"
services = _run_cmd(services_cmd, shell=True).split() services = _run_cmd(services_cmd, shell=True).split()
parsed_services = []
service_versions = {} service_versions = {}
for service in services: for service in services:
if service in parsed_services:
continue
services_cmd = f"yq e '.services.{service}.image' compose*.yml" services_cmd = f"yq e '.services.{service}.image' compose*.yml"
images = _run_cmd(services_cmd, shell=True).split() 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}") log.info(f"Parsed {service_version_info}")
service_versions[service] = service_version_info service_versions[service] = service_version_info
parsed_services.append(service)
versions[tag] = service_versions versions[tag] = service_versions
_run_cmd("git checkout HEAD") _run_cmd("git checkout HEAD")