From a28ed45afbad2b519814d6103160c18496051993 Mon Sep 17 00:00:00 2001 From: Marc Olivier Bergeron Date: Fri, 30 May 2025 23:09:28 -0400 Subject: [PATCH] Added production flag to the redeploy argument. --- .github/workflows/tests.yml | 2 +- ctf/__main__.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 037fc9c..55edcc1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -149,7 +149,7 @@ jobs: - name: Test deployment of a track not deployed without destroying the rest run: | - ctf deploy --production --production --tracks mock-track-apache-php + ctf deploy --production --tracks mock-track-apache-php [ "$(incus list --all-projects -cn -fcsv | wc -l)" -eq 1 ] || exit 1 ctf redeploy --production --tracks mock-track-python-service [ "$(incus list --all-projects -cn -fcsv | wc -l)" -eq 2 ] || exit 1 diff --git a/ctf/__main__.py b/ctf/__main__.py index 5b85824..8c6a996 100644 --- a/ctf/__main__.py +++ b/ctf/__main__.py @@ -847,7 +847,6 @@ def run_ansible_playbook(args: argparse.Namespace, track: str, path: str) -> Non def redeploy(args: argparse.Namespace) -> None: - args.production = False destroy(args=args) deploy(args=args) @@ -1381,6 +1380,12 @@ def main(): default=[], help="Only redeploy the given tracks (use the folder name)", ) + parser_redeploy.add_argument( + "--production", + action="store_true", + default=False, + help="Do a production deployment. Only use this if you know what you're doing.", + ) parser_redeploy.add_argument( "--remote", default="local",