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

View file

@ -2,7 +2,7 @@
"""Entry point."""
import cd
import cidd
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
if TYPE_CHECKING:
from cd.projects import Projects
from cidd.projects import Projects
BRANCH = [
"GITHUB_REF_NAME",