| 69 | |
| 70 | |
| 71 | class DeploymentPlan: |
| 72 | def __init__(self, console_start: str, worker_runtime: str, worker_start: str): |
| 73 | self.console_start = console_start # "docker" | "systemd" | "foreground" |
| 74 | self.worker_runtime = worker_runtime # "docker" | "boxlite" |
| 75 | self.worker_start = worker_start # "systemd" | "foreground" |
| 76 | |
| 77 | @property |
| 78 | def worker_service_name(self) -> str: |
| 79 | return f"onlyboxes-worker-{self.worker_runtime}" |
| 80 | |
| 81 | @property |
| 82 | def worker_binary_name(self) -> str: |
| 83 | return f"onlyboxes-worker-{self.worker_runtime}" |
| 84 | |
| 85 | @property |
| 86 | def worker_asset_template(self) -> str: |
| 87 | if self.worker_runtime == "docker": |
| 88 | return WORKER_DOCKER_ASSET_TEMPLATE |
| 89 | return WORKER_BOXLITE_ASSET_TEMPLATE |
| 90 | |
| 91 | @property |
| 92 | def has_foreground(self) -> bool: |
| 93 | return self.console_start == "foreground" or self.worker_start == "foreground" |
| 94 | |
| 95 | |
| 96 | # --------------------------------------------------------------------------- |
no outgoing calls
no test coverage detected