diff --git a/app/__pycache__/__init__.cpython-38.pyc b/app/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..42da53cc Binary files /dev/null and b/app/__pycache__/__init__.cpython-38.pyc differ diff --git a/app/__pycache__/__init__.cpython-39.pyc b/app/__pycache__/__init__.cpython-39.pyc new file mode 100644 index 00000000..00879fd4 Binary files /dev/null and b/app/__pycache__/__init__.cpython-39.pyc differ diff --git a/app/__pycache__/build_containers.cpython-38.pyc b/app/__pycache__/build_containers.cpython-38.pyc new file mode 100644 index 00000000..0a58c334 Binary files /dev/null and b/app/__pycache__/build_containers.cpython-38.pyc differ diff --git a/app/__pycache__/build_containers.cpython-39.pyc b/app/__pycache__/build_containers.cpython-39.pyc new file mode 100644 index 00000000..5e544127 Binary files /dev/null and b/app/__pycache__/build_containers.cpython-39.pyc differ diff --git a/app/__pycache__/deploy_system.cpython-38.pyc b/app/__pycache__/deploy_system.cpython-38.pyc new file mode 100644 index 00000000..f507c8bd Binary files /dev/null and b/app/__pycache__/deploy_system.cpython-38.pyc differ diff --git a/app/__pycache__/deploy_system.cpython-39.pyc b/app/__pycache__/deploy_system.cpython-39.pyc new file mode 100644 index 00000000..82705c0d Binary files /dev/null and b/app/__pycache__/deploy_system.cpython-39.pyc differ diff --git a/app/__pycache__/setup_repositories.cpython-38.pyc b/app/__pycache__/setup_repositories.cpython-38.pyc new file mode 100644 index 00000000..37c8fa4f Binary files /dev/null and b/app/__pycache__/setup_repositories.cpython-38.pyc differ diff --git a/app/__pycache__/setup_repositories.cpython-39.pyc b/app/__pycache__/setup_repositories.cpython-39.pyc new file mode 100644 index 00000000..f21b25d8 Binary files /dev/null and b/app/__pycache__/setup_repositories.cpython-39.pyc differ diff --git a/app/build_containers.py b/app/build_containers.py index d1cc3c7e..b0bb229f 100644 --- a/app/build_containers.py +++ b/app/build_containers.py @@ -27,25 +27,28 @@ from decouple import config import subprocess import click -parser = argparse.ArgumentParser( - description="build the set of containers required for a complete stack", - epilog="Config provided either in .env or settings.ini or env vars: CERC_REPO_BASE_DIR (defaults to ~/cerc)" - ) -parser.add_argument("--verbose", action="store_true", help="increase output verbosity") -parser.add_argument("--quiet", action="store_true", help="don\'t print informational output") -parser.add_argument("--check-only", action="store_true", help="looks at what\'s already there and checks if it looks good") -parser.add_argument("--dry-run", action="store_true", help="don\'t do anything, just print the commands that would be executed") +#parser = argparse.ArgumentParser( +# description="build the set of containers required for a complete stack", +# epilog="Config provided either in .env or settings.ini or env vars: CERC_REPO_BASE_DIR (defaults to ~/cerc)" +# ) +#parser.add_argument("--verbose", action="store_true", help="increase output verbosity") +#parser.add_argument("--quiet", action="store_true", help="don\'t print informational output") +#parser.add_argument("--check-only", action="store_true", help="looks at what\'s already there and checks if it looks good") +#parser.add_argument("--dry-run", action="store_true", help="don\'t do anything, just print the commands that would be executed") -args = parser.parse_args() +#args = parser.parse_args() @click.command() -def command(): - verbose = args.verbose - quiet = args.quiet +@click.pass_context +def command(ctx): + + quiet = ctx.obj.quiet + verbose = ctx.obj.verbose + dry_run = ctx.obj.verbose dev_root_path = os.path.expanduser(config("CERC_REPO_BASE_DIR", default="~/cerc")) - if not args.quiet: + if not quiet: print(f'Dev Root is: {dev_root_path}') if not os.path.isdir(dev_root_path): @@ -66,7 +69,7 @@ def command(): if not os.path.exists(build_script_filename): print(f"Error, script: {build_script_filename} doesn't exist") sys.exit(1) - if not args.dry_run: + if not dry_run: # We need to export CERC_REPO_BASE_DIR build_result = subprocess.run(build_script_filename, shell=True, env={'CERC_REPO_BASE_DIR':dev_root_path}) # TODO: check result in build_result.returncode diff --git a/app/deploy_system.py b/app/deploy_system.py index 7c2195ae..606280d4 100644 --- a/app/deploy_system.py +++ b/app/deploy_system.py @@ -51,7 +51,12 @@ def include_exclude_check(s, args): #print("Yo2!") @click.command() -def command(): +@click.pass_context +def command(ctx): + + quiet = ctx.obj.quiet + verbose = ctx.obj.verbose + dry_run = ctx.obj.verbose with open("cluster-list.txt") as cluster_list_file: clusters = cluster_list_file.read().splitlines() @@ -76,8 +81,8 @@ def command(): # See: https://gabrieldemarmiesse.github.io/python-on-whales/sub-commands/compose/ docker = DockerClient(compose_files=compose_files) - command = args.command[0] - if not args.dry_run: + command = "hack" + if not dry_run: if command == "up": if verbose: print("Running compose up")