From 447e1215ad74240d6e9306480691a80f0a73a507 Mon Sep 17 00:00:00 2001 From: "jonathan@vulcanize.io" Date: Wed, 13 Mar 2024 03:56:17 +0000 Subject: [PATCH] copy whether absolute path or local --- .../data/stacks/blast/deploy/commands.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/stack_orchestrator/data/stacks/blast/deploy/commands.py b/stack_orchestrator/data/stacks/blast/deploy/commands.py index 8b5768fe..662dc4fb 100644 --- a/stack_orchestrator/data/stacks/blast/deploy/commands.py +++ b/stack_orchestrator/data/stacks/blast/deploy/commands.py @@ -16,13 +16,22 @@ from pathlib import Path from shutil import copy - +import yaml def create(context, extra_args): # Our goal here is just to copy the json files for blast - deployment_config_dir = context.deployment_dir.joinpath("data", "blast-data") + yml_path = context.deployment_dir.joinpath("spec.yml") + with open(yml_path, 'r') as file: + data = yaml.safe_load(file) + + mount_point = data['volumes']['blast-data'] + if mount_point[0] == "/": + deploy_dir = Path(mount_point) + else: + deploy_dir = context.deployment_dir.joinpath(mount_point) + command_context = extra_args[2] compose_file = [f for f in command_context.cluster_context.compose_files if "blast" in f][0] source_config_file = Path(compose_file).parent.parent.joinpath("config", "blast", "genesis.json") - copy(source_config_file, deployment_config_dir) + copy(source_config_file, deploy_dir)