From 0cadc0fca9749e4b339d5cfea62411d51ce5048f Mon Sep 17 00:00:00 2001 From: Darren <27513732@qq.com> Date: Wed, 6 Dec 2023 08:11:08 +0800 Subject: [PATCH] test build files --- apps/activemq/docker-compose-artemis.yml | 2 +- apps/activemq/docker-compose-classic.yml | 2 +- build/compose_files.py | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/activemq/docker-compose-artemis.yml b/apps/activemq/docker-compose-artemis.yml index 8c6a58c91..0c9102c5f 100644 --- a/apps/activemq/docker-compose-artemis.yml +++ b/apps/activemq/docker-compose-artemis.yml @@ -1,4 +1,4 @@ -# only for artemis Activemq +# only for artemis activemq version: "3.8" diff --git a/apps/activemq/docker-compose-classic.yml b/apps/activemq/docker-compose-classic.yml index 38045fc49..8049a6498 100644 --- a/apps/activemq/docker-compose-classic.yml +++ b/apps/activemq/docker-compose-classic.yml @@ -1,4 +1,4 @@ -# only for classic Activemq +# only for classic activemq version: "3.8" services: diff --git a/build/compose_files.py b/build/compose_files.py index 3d1cd7f9e..0ccb62e95 100644 --- a/build/compose_files.py +++ b/build/compose_files.py @@ -11,14 +11,14 @@ # Remove any empty strings from the list filenames = [filename for filename in filenames if filename] -# Load the base docker-compose file -with open('docker-compose.yml', 'r') as base_file: - base_config = yaml.safe_load(base_file) - for filename in filenames: # 获取文件的目录和基础名 directory, basename = os.path.split(filename) + # Load the base docker-compose file from the same directory as filename + with open(os.path.join(directory, 'docker-compose.yml'), 'r') as base_file: + base_config = yaml.safe_load(base_file) + # 从基础名中提取 * 部分 name_part = basename.split('-')[2].split('.')[0] # 从 'docker-compose-*.yml' 中提取 '*' @@ -34,4 +34,4 @@ # Write the merged configuration to the new file with open(new_filename, 'w') as output_file: - yaml.safe_dump(base_config, output_file) \ No newline at end of file + yaml \ No newline at end of file