Skip to content

Commit

Permalink
quick workaround to test
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Skinstad Drabitzius <[email protected]>
  • Loading branch information
danielskinstad committed Jan 28, 2025
1 parent ce4f217 commit ec43d3f
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion extra/release_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,23 @@ def version_specific_docker_compose_data_patching(data, rev):

return data

def get_compose_values():
compose_sub = {}
with open(os.path.join(integration_dir(), ".env")) as f:
for line in f:
try:
key, value = line.strip().split('=')
compose_sub[key] = value
except:
pass

return compose_sub

def substitute_values_in_json_list(json_list, env_substitute):
for key, value in env_substitute.items():
for i, json_data in enumerate(json_list):
json_list[i] = json_data.replace("${" + key + "}", value)
return json_list

def get_docker_compose_data(dir, version="git"):
"""Return docker-compose data from all the YML files in the directory.
Expand All @@ -553,7 +570,9 @@ def get_docker_compose_data(dir, version="git"):
with open(filename) as fd:
json_list.append(fd.read())

return get_docker_compose_data_from_json_list(json_list)
env_substitute = get_compose_values()
s_json_list = substitute_values_in_json_list(json_list, env_substitute)
return get_docker_compose_data_from_json_list(s_json_list)


def get_docker_compose_data_for_rev(git_dir, rev, version="git"):
Expand Down

0 comments on commit ec43d3f

Please sign in to comment.