mirror of
https://github.com/dredx/prole.git
synced 2026-09-28 18:54:30 +00:00
- Add root-level installer package: config, build, workstation, deploy - Update install.py to import from installer.* - Ensure build/deploy use top-level proleStatus only (no prole/proleStatus) - Keep UI/behavior intact (wizard pages, embedded console) This commit contains only files required to run ./install.py and the new installer/* modules.
27 lines
963 B
Python
27 lines
963 B
Python
"""
|
|
Workstation (Vagrant) build helpers for the Prole installer (root-level).
|
|
|
|
Select an environment-specific Vagrantfile when present and compose the
|
|
`vagrant up` command. UI remains elsewhere.
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
def select_vagrantfile(project_root: Path, env: str | None) -> Path:
|
|
env_key = (env or "Dev").strip().lower()
|
|
mapping = {"dev": "Vagrantfile.dev", "service": "Vagrantfile.service", "prod": "Vagrantfile.prod"}
|
|
ws = Path(project_root) / "workstation"
|
|
candidate = mapping.get(env_key)
|
|
if candidate and (ws / candidate).exists():
|
|
return ws / candidate
|
|
return ws / "Vagrantfile"
|
|
|
|
|
|
def get_vagrant_up_command(project_root: Path, env: str | None) -> str:
|
|
vf = select_vagrantfile(project_root, env)
|
|
ws = Path(project_root) / "workstation"
|
|
env_label = (env or "Dev").strip().title()
|
|
return f"cd \"{ws}\" && VAGRANT_VAGRANTFILE=\"{vf}\" vagrant up # {env_label}"
|