This commit is contained in:
Marc Beninca 2024-06-21 13:07:44 +02:00
parent c0079994e6
commit 6aedbd3c7c
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
3 changed files with 23 additions and 23 deletions

View file

@ -1,4 +1,4 @@
"""Continuous Deployment.""" """Continuous Integration, Delivery & Deployment."""
__version__ = "0.0.1" __version__ = "0.0.1"
@ -10,21 +10,21 @@ import env
from rwx import fs, ps from rwx import fs, ps
from rwx.log import stream as log from rwx.log import stream as log
import cd import cidd
from cd.project import Project from cidd.project import Project
from cd.projects import Projects from cidd.projects import Projects
COMMANDS_PREFIX = "cd-" COMMANDS_PREFIX = "cidd-"
projects = Projects() projects = Projects()
project = Project(projects) project = Project(projects)
def cd_browse_workspace() -> None: def cidd_browse_workspace() -> None:
browse(project.root) browse(project.root)
def cd_build_project() -> None: def cidd_build_project() -> None:
for extension in ["py", "sh"]: for extension in ["py", "sh"]:
path = Path(project.root) / f"build.{extension}" path = Path(project.root) / f"build.{extension}"
if path.exists(): if path.exists():
@ -34,7 +34,7 @@ def cd_build_project() -> None:
pass pass
def cd_clone_branch() -> None: def cidd_clone_branch() -> None:
log.info(projects) log.info(projects)
split() split()
log.info(project) log.info(project)
@ -58,12 +58,12 @@ def cd_clone_branch() -> None:
) )
def cd_list_environment() -> None: def cidd_list_environment() -> None:
for variable, value in sorted(projects.environment.items()): for variable, value in sorted(projects.environment.items()):
log.info(f"{variable} = {value}") log.info(f"{variable} = {value}")
def cd_synchronize() -> None: def cidd_synchronize() -> None:
host = "rwx.work" host = "rwx.work"
source = "out" source = "out"
user = "cd" user = "cd"
@ -119,10 +119,10 @@ def main() -> None:
path, *arguments = sys.argv path, *arguments = sys.argv
name = Path(path).name name = Path(path).name
if name == "__main__.py": if name == "__main__.py":
cd.set_ssh(*arguments) cidd.set_ssh(*arguments)
cd.install_commands(__file__) cidd.install_commands(__file__)
else: else:
function = getattr(cd, name.replace("-", "_")) function = getattr(cidd, name.replace("-", "_"))
function(*arguments) function(*arguments)
@ -154,19 +154,19 @@ def set_ssh(*arguments: str) -> None:
def frame(text: str) -> None: def frame(text: str) -> None:
log.info(f"{env.CD_OPEN}{text}") log.info(f"{env.CIDD_OPEN}{text}")
def shut(text: str) -> None: def shut(text: str) -> None:
log.info(f"{env.CD_SHUT}{text}") log.info(f"{env.CIDD_SHUT}{text}")
def split() -> None: def split() -> None:
log.info(env.CD_SPLT) log.info(env.CIDD_SPLT)
def step(text: str) -> None: def step(text: str) -> None:
env.CD_STEP += 1 env.CIDD_STEP += 1
log.info(env.CD_DOWN) log.info(env.CIDD_DOWN)
log.info(f"{env.CD_VERT} {env.CD_STEP} {text}") log.info(f"{env.CIDD_VERT} {env.CIDD_STEP} {text}")
log.info(env.CD___UP) log.info(env.CIDD___UP)

View file

@ -2,7 +2,7 @@
"""Entry point.""" """Entry point."""
import cd import cidd
if __name__ == "__main__": if __name__ == "__main__":
cd.main(__file__) cidd.main(__file__)

View file

@ -7,7 +7,7 @@ from typing import TYPE_CHECKING
from urllib.parse import urljoin from urllib.parse import urljoin
if TYPE_CHECKING: if TYPE_CHECKING:
from cd.projects import Projects from cidd.projects import Projects
BRANCH = [ BRANCH = [
"GITHUB_REF_NAME", "GITHUB_REF_NAME",