Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom values files for --from-live #2850

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@
help="The live server that should be pointed to, if --from-live is set",
)

config_parser.add_argument(
"--custom-values",
help="Custom values file for helm chart"
)



args = parser.parse_args()
Expand Down Expand Up @@ -136,7 +141,7 @@ def main():
elif args.subcommand == "upgrade":
handle_helm_upgrade()
elif args.subcommand == "config":
generate_configs(args.from_live, args.live_host)
generate_configs(args.from_live, args.live_host, args.custom_values)


def handle_cluster():
Expand Down Expand Up @@ -255,7 +260,7 @@ def get_codespace_name():
return os.environ.get("CODESPACE_NAME", None)


def generate_configs(from_live, live_host):
def generate_configs(from_live, live_host, custom_values):
temp_dir_path = Path(tempfile.mkdtemp())


Expand All @@ -273,7 +278,8 @@ def generate_configs(from_live, live_host):
backend_config_path,
codespace_name,
from_live,
live_host
live_host,
custom_values
)

website_config_path = temp_dir_path / "website_config.json"
Expand All @@ -283,7 +289,8 @@ def generate_configs(from_live, live_host):
website_config_path,
codespace_name,
from_live,
live_host
live_host,
custom_values
)

runtime_config_path = temp_dir_path / "runtime_config.json"
Expand All @@ -293,7 +300,8 @@ def generate_configs(from_live, live_host):
runtime_config_path,
codespace_name,
from_live,
live_host
live_host,
custom_values
)

ingest_configmap_path = temp_dir_path / "config.yaml"
Expand All @@ -306,6 +314,7 @@ def generate_configs(from_live, live_host):
codespace_name,
from_live,
live_host,
custom_values,
ingest_configout_path
)

Expand All @@ -319,6 +328,7 @@ def generate_configs(from_live, live_host):
codespace_name,
from_live,
live_host,
custom_values,
prepro_configout_path
)

Expand All @@ -340,6 +350,7 @@ def generate_config(
codespace_name=None,
from_live=False,
live_host=None,
custom_values=None,
output_path=None,
):
if from_live and live_host:
Expand All @@ -355,6 +366,8 @@ def generate_config(
"--show-only",
template,
]
if custom_values:
helm_template_cmd.extend(["-f", custom_values])

if not output_path:
output_path = configmap_path
Expand Down
Loading