From 963d10ccb83c81e9e1bdff2225a0a8ca56d86aae Mon Sep 17 00:00:00 2001 From: Grashalmbeisser <57599830+Grashalmbeisser@users.noreply.github.com> Date: Fri, 23 Feb 2024 15:15:42 +0100 Subject: [PATCH] Feature/indexfix (#111) * clean indices * clean indices and smaller bugfixes * Update src/viur_cli/update.py Co-authored-by: Jan Max Meyer --------- Co-authored-by: Jan Max Meyer --- src/viur_cli/cloud.py | 11 +++++++++++ src/viur_cli/update.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/viur_cli/cloud.py b/src/viur_cli/cloud.py index 6f19c71..504bda9 100644 --- a/src/viur_cli/cloud.py +++ b/src/viur_cli/cloud.py @@ -84,6 +84,17 @@ def enable_gcp_backup(): print('Success! It may take a while until you can use Gcloud Backups') +@cloud.command(context_settings={"ignore_unknown_options": True}) +@click.argument("service", type=click.Choice(["gcloud"]), default="gcloud") +@click.argument("option", type=click.Choice(["datastore"]), default="datastore") +@click.argument("profile", default="default") +def cleanup(service, option, profile): + conf = config.get_profile(profile) + + if service == "gcloud" and option == "datastore": + run_command(f"gcloud datastore indexes cleanup deploy/index.yaml --project={conf['application_name']}") + + @cloud.command(context_settings={"ignore_unknown_options": True}) @click.argument("action", type=click.Choice(["backup"])) def disable(action): diff --git a/src/viur_cli/update.py b/src/viur_cli/update.py index 3b9249f..7de2a60 100644 --- a/src/viur_cli/update.py +++ b/src/viur_cli/update.py @@ -29,7 +29,7 @@ def update(action, profile, additional_args): conf = config.get_profile(profile) if action == "requirements": - create_req(profile) + create_req(True, profile)