mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-30 14:56:11 +00:00
# Conflicts: # cli/administration/deploy/development/down.py # cli/administration/deploy/development/inventory/__init__.py # tests/unit/python/utils/cache/test_base.py # tests/unit/python/utils/cache/test_data.py
27 lines
650 B
Python
27 lines
650 B
Python
from __future__ import annotations
|
|
|
|
from typing import TYPE_CHECKING
|
|
|
|
from utils.cache import PROJECT_ROOT
|
|
|
|
from .compose import Compose
|
|
from .env import resolve_distro
|
|
|
|
if TYPE_CHECKING:
|
|
import argparse
|
|
from pathlib import Path
|
|
|
|
|
|
def down_stack(*, repo_root: Path, distro: str) -> None:
|
|
Compose(repo_root=repo_root, distro=distro).down()
|
|
|
|
|
|
def add_parser(sub: argparse._SubParsersAction) -> None:
|
|
p = sub.add_parser("down", help="Stop compose stack and remove volumes.")
|
|
p.set_defaults(_handler=handler)
|
|
|
|
|
|
def handler(args: argparse.Namespace) -> int:
|
|
down_stack(repo_root=PROJECT_ROOT, distro=resolve_distro())
|
|
return 0
|