cidd → pidd

This commit is contained in:
Marc Beninca 2024-06-21 14:57:57 +02:00
parent 42c05eecb7
commit 9f12c01057
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
22 changed files with 664 additions and 664 deletions

View file

@ -4,13 +4,13 @@ jobs:
container: container:
image: almalinux:8 image: almalinux:8
steps: steps:
- name: cidd - name: pidd
run: > run: >
${{vars.CIDD}} ${{vars.PIDD}}
"${{secrets.CIDD_SSH_KEY}}" "${{secrets.PIDD_SSH_KEY}}"
"${{vars.CIDD_SSH_HOSTS}}" "${{vars.PIDD_SSH_HOSTS}}"
- run: cidd-list-environment - run: pidd-list-environment
- run: cidd-clone-branch - run: pidd-clone-branch
- run: cidd-build-project - run: pidd-build-project
- run: cidd-browse-workspace - run: pidd-browse-workspace

View file

@ -4,13 +4,13 @@ jobs:
container: container:
image: almalinux:9 image: almalinux:9
steps: steps:
- name: cidd - name: pidd
run: > run: >
${{vars.CIDD}} ${{vars.PIDD}}
"${{secrets.CIDD_SSH_KEY}}" "${{secrets.PIDD_SSH_KEY}}"
"${{vars.CIDD_SSH_HOSTS}}" "${{vars.PIDD_SSH_HOSTS}}"
- run: cidd-list-environment - run: pidd-list-environment
- run: cidd-clone-branch - run: pidd-clone-branch
- run: cidd-build-project - run: pidd-build-project
- run: cidd-browse-workspace - run: pidd-browse-workspace

View file

@ -4,13 +4,13 @@ jobs:
container: container:
image: alpine:3.18 image: alpine:3.18
steps: steps:
- name: cidd - name: pidd
run: > run: >
${{vars.CIDD}} ${{vars.PIDD}}
"${{secrets.CIDD_SSH_KEY}}" "${{secrets.PIDD_SSH_KEY}}"
"${{vars.CIDD_SSH_HOSTS}}" "${{vars.PIDD_SSH_HOSTS}}"
- run: cidd-list-environment - run: pidd-list-environment
- run: cidd-clone-branch - run: pidd-clone-branch
- run: cidd-build-project - run: pidd-build-project
- run: cidd-browse-workspace - run: pidd-browse-workspace

View file

@ -4,13 +4,13 @@ jobs:
container: container:
image: alpine:3.19 image: alpine:3.19
steps: steps:
- name: cidd - name: pidd
run: > run: >
${{vars.CIDD}} ${{vars.PIDD}}
"${{secrets.CIDD_SSH_KEY}}" "${{secrets.PIDD_SSH_KEY}}"
"${{vars.CIDD_SSH_HOSTS}}" "${{vars.PIDD_SSH_HOSTS}}"
- run: cidd-list-environment - run: pidd-list-environment
- run: cidd-clone-branch - run: pidd-clone-branch
- run: cidd-build-project - run: pidd-build-project
- run: cidd-browse-workspace - run: pidd-browse-workspace

View file

@ -4,13 +4,13 @@ jobs:
container: container:
image: archlinux:base-20231112.0.191179 image: archlinux:base-20231112.0.191179
steps: steps:
- name: cidd - name: pidd
run: > run: >
${{vars.CIDD}} ${{vars.PIDD}}
"${{secrets.CIDD_SSH_KEY}}" "${{secrets.PIDD_SSH_KEY}}"
"${{vars.CIDD_SSH_HOSTS}}" "${{vars.PIDD_SSH_HOSTS}}"
- run: cidd-list-environment - run: pidd-list-environment
- run: cidd-clone-branch - run: pidd-clone-branch
- run: cidd-build-project - run: pidd-build-project
- run: cidd-browse-workspace - run: pidd-browse-workspace

View file

@ -4,13 +4,13 @@ jobs:
container: container:
image: archlinux:base-20240101.0.204074 image: archlinux:base-20240101.0.204074
steps: steps:
- name: cidd - name: pidd
run: > run: >
${{vars.CIDD}} ${{vars.PIDD}}
"${{secrets.CIDD_SSH_KEY}}" "${{secrets.PIDD_SSH_KEY}}"
"${{vars.CIDD_SSH_HOSTS}}" "${{vars.PIDD_SSH_HOSTS}}"
- run: cidd-list-environment - run: pidd-list-environment
- run: cidd-clone-branch - run: pidd-clone-branch
- run: cidd-build-project - run: pidd-build-project
- run: cidd-browse-workspace - run: pidd-browse-workspace

View file

@ -4,14 +4,14 @@ jobs:
container: container:
image: debian:bookworm image: debian:bookworm
steps: steps:
- name: cidd - name: pidd
run: > run: >
${{vars.CIDD}} ${{vars.PIDD}}
"${{secrets.CIDD_SSH_KEY}}" "${{secrets.PIDD_SSH_KEY}}"
"${{vars.CIDD_SSH_HOSTS}}" "${{vars.PIDD_SSH_HOSTS}}"
- run: cidd-list-environment - run: pidd-list-environment
- run: cidd-clone-branch - run: pidd-clone-branch
- run: cidd-build-project - run: pidd-build-project
- run: cidd-browse-workspace - run: pidd-browse-workspace
- run: cidd-synchronize - run: pidd-synchronize

View file

@ -4,13 +4,13 @@ jobs:
container: container:
image: debian:bullseye image: debian:bullseye
steps: steps:
- name: cidd - name: pidd
run: > run: >
${{vars.CIDD}} ${{vars.PIDD}}
"${{secrets.CIDD_SSH_KEY}}" "${{secrets.PIDD_SSH_KEY}}"
"${{vars.CIDD_SSH_HOSTS}}" "${{vars.PIDD_SSH_HOSTS}}"
- run: cidd-list-environment - run: pidd-list-environment
- run: cidd-clone-branch - run: pidd-clone-branch
- run: cidd-build-project - run: pidd-build-project
- run: cidd-browse-workspace - run: pidd-browse-workspace

View file

@ -4,13 +4,13 @@ jobs:
container: container:
image: fedora:39 image: fedora:39
steps: steps:
- name: cidd - name: pidd
run: > run: >
${{vars.CIDD}} ${{vars.PIDD}}
"${{secrets.CIDD_SSH_KEY}}" "${{secrets.PIDD_SSH_KEY}}"
"${{vars.CIDD_SSH_HOSTS}}" "${{vars.PIDD_SSH_HOSTS}}"
- run: cidd-list-environment - run: pidd-list-environment
- run: cidd-clone-branch - run: pidd-clone-branch
- run: cidd-build-project - run: pidd-build-project
- run: cidd-browse-workspace - run: pidd-browse-workspace

View file

@ -4,13 +4,13 @@ jobs:
container: container:
image: fedora:40 image: fedora:40
steps: steps:
- name: cidd - name: pidd
run: > run: >
${{vars.CIDD}} ${{vars.PIDD}}
"${{secrets.CIDD_SSH_KEY}}" "${{secrets.PIDD_SSH_KEY}}"
"${{vars.CIDD_SSH_HOSTS}}" "${{vars.PIDD_SSH_HOSTS}}"
- run: cidd-list-environment - run: pidd-list-environment
- run: cidd-clone-branch - run: pidd-clone-branch
- run: cidd-build-project - run: pidd-build-project
- run: cidd-browse-workspace - run: pidd-browse-workspace

View file

@ -4,13 +4,13 @@ jobs:
container: container:
image: rockylinux:8 image: rockylinux:8
steps: steps:
- name: cidd - name: pidd
run: > run: >
${{vars.CIDD}} ${{vars.PIDD}}
"${{secrets.CIDD_SSH_KEY}}" "${{secrets.PIDD_SSH_KEY}}"
"${{vars.CIDD_SSH_HOSTS}}" "${{vars.PIDD_SSH_HOSTS}}"
- run: cidd-list-environment - run: pidd-list-environment
- run: cidd-clone-branch - run: pidd-clone-branch
- run: cidd-build-project - run: pidd-build-project
- run: cidd-browse-workspace - run: pidd-browse-workspace

View file

@ -4,13 +4,13 @@ jobs:
container: container:
image: rockylinux:9 image: rockylinux:9
steps: steps:
- name: cidd - name: pidd
run: > run: >
${{vars.CIDD}} ${{vars.PIDD}}
"${{secrets.CIDD_SSH_KEY}}" "${{secrets.PIDD_SSH_KEY}}"
"${{vars.CIDD_SSH_HOSTS}}" "${{vars.PIDD_SSH_HOSTS}}"
- run: cidd-list-environment - run: pidd-list-environment
- run: cidd-clone-branch - run: pidd-clone-branch
- run: cidd-build-project - run: pidd-build-project
- run: cidd-browse-workspace - run: pidd-browse-workspace

View file

@ -4,13 +4,13 @@ jobs:
container: container:
image: ubuntu:jammy image: ubuntu:jammy
steps: steps:
- name: cidd - name: pidd
run: > run: >
${{vars.CIDD}} ${{vars.PIDD}}
"${{secrets.CIDD_SSH_KEY}}" "${{secrets.PIDD_SSH_KEY}}"
"${{vars.CIDD_SSH_HOSTS}}" "${{vars.PIDD_SSH_HOSTS}}"
- run: cidd-list-environment - run: pidd-list-environment
- run: cidd-clone-branch - run: pidd-clone-branch
- run: cidd-build-project - run: pidd-build-project
- run: cidd-browse-workspace - run: pidd-browse-workspace

View file

@ -4,13 +4,13 @@ jobs:
container: container:
image: ubuntu:noble image: ubuntu:noble
steps: steps:
- name: cidd - name: pidd
run: > run: >
${{vars.CIDD}} ${{vars.PIDD}}
"${{secrets.CIDD_SSH_KEY}}" "${{secrets.PIDD_SSH_KEY}}"
"${{vars.CIDD_SSH_HOSTS}}" "${{vars.PIDD_SSH_HOSTS}}"
- run: cidd-list-environment - run: pidd-list-environment
- run: cidd-clone-branch - run: pidd-clone-branch
- run: cidd-build-project - run: pidd-build-project
- run: cidd-browse-workspace - run: pidd-browse-workspace

View file

@ -5,14 +5,14 @@ jobs:
container: container:
image: debian:bookworm image: debian:bookworm
steps: steps:
- name: cidd - name: pidd
run: > run: >
echo '${{vars.CIDD}}' | tr -d '\r' | sh -s echo '${{vars.PIDD}}' | tr -d '\r' | sh -s
"${{secrets.CIDD_SSH_KEY}}" "${{secrets.PIDD_SSH_KEY}}"
"${{vars.CIDD_SSH_HOSTS}}" "${{vars.PIDD_SSH_HOSTS}}"
- run: cidd-list-environment - run: pidd-list-environment
- run: cidd-clone-branch - run: pidd-clone-branch
- run: cidd-build-project - run: pidd-build-project
- run: cidd-browse-workspace - run: pidd-browse-workspace
- run: cidd-synchronize - run: pidd-synchronize

View file

@ -2,11 +2,11 @@ image: debian:bookworm
job: job:
script: script:
- > - >
sh ${CIDD} sh ${PIDD}
${CIDD_SSH_KEY} ${PIDD_SSH_KEY}
${CIDD_SSH_HOSTS} ${PIDD_SSH_HOSTS}
- cidd-list-environment - pidd-list-environment
- cidd-clone-branch - pidd-clone-branch
- cidd-build-project - pidd-build-project
- cidd-browse-workspace - pidd-browse-workspace

996
pidd.sh

File diff suppressed because it is too large Load diff

View file

@ -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 cidd import pidd
from cidd.project import Project from pidd.project import Project
from cidd.projects import Projects from pidd.projects import Projects
COMMANDS_PREFIX = "cidd-" COMMANDS_PREFIX = "pidd-"
projects = Projects() projects = Projects()
project = Project(projects) project = Project(projects)
def cidd_browse_workspace() -> None: def pidd_browse_workspace() -> None:
browse(project.root) browse(project.root)
def cidd_build_project() -> None: def pidd_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 cidd_build_project() -> None:
pass pass
def cidd_clone_branch() -> None: def pidd_clone_branch() -> None:
log.info(projects) log.info(projects)
split() split()
log.info(project) log.info(project)
@ -58,12 +58,12 @@ def cidd_clone_branch() -> None:
) )
def cidd_list_environment() -> None: def pidd_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 cidd_synchronize() -> None: def pidd_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":
cidd.set_ssh(*arguments) pidd.set_ssh(*arguments)
cidd.install_commands(__file__) pidd.install_commands(__file__)
else: else:
function = getattr(cidd, name.replace("-", "_")) function = getattr(pidd, 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.CIDD_OPEN}{text}") log.info(f"{env.PIDD_OPEN}{text}")
def shut(text: str) -> None: def shut(text: str) -> None:
log.info(f"{env.CIDD_SHUT}{text}") log.info(f"{env.PIDD_SHUT}{text}")
def split() -> None: def split() -> None:
log.info(env.CIDD_SPLT) log.info(env.PIDD_SPLT)
def step(text: str) -> None: def step(text: str) -> None:
env.CIDD_STEP += 1 env.PIDD_STEP += 1
log.info(env.CIDD_DOWN) log.info(env.PIDD_DOWN)
log.info(f"{env.CIDD_VERT} {env.CIDD_STEP} {text}") log.info(f"{env.PIDD_VERT} {env.PIDD_STEP} {text}")
log.info(env.CIDD___UP) log.info(env.PIDD___UP)

View file

@ -2,7 +2,7 @@
"""Entry point.""" """Entry point."""
import cidd import pidd
if __name__ == "__main__": if __name__ == "__main__":
cidd.main(__file__) pidd.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 cidd.projects import Projects from pidd.projects import Projects
BRANCH = [ BRANCH = [
"GITHUB_REF_NAME", "GITHUB_REF_NAME",

View file

@ -19,7 +19,7 @@ description = "Continuous Integration, Delivery & Deployment"
dynamic = ["version"] dynamic = ["version"]
keywords = [] keywords = []
license-files = { paths = ["license.md"] } license-files = { paths = ["license.md"] }
name = "cidd" name = "pidd"
readme = "readme.md" readme = "readme.md"
requires-python = ">= 3.10" requires-python = ">= 3.10"
@ -29,7 +29,7 @@ requires-python = ">= 3.10"
[project.urls] [project.urls]
[tool.hatch.version] [tool.hatch.version]
path = "cidd/__init__.py" path = "pidd/__init__.py"
[tool.ruff] [tool.ruff]
line-length = 80 line-length = 80

View file

@ -41,19 +41,19 @@ from various contexts of CA, CI and OCI / OS.
| Variable | Description | Default | | Variable | Description | Default |
|:----------------|:------------------------|:--------------------------------| |:----------------|:------------------------|:--------------------------------|
| CIDD_CA_n | Numbered CA certificate | | | PIDD_CA_n | Numbered CA certificate | |
| CIDD_DNS | Space separated servers | 9.9.9.9 | | PIDD_DNS | Space separated servers | 9.9.9.9 |
| CIDD_GIT_CHILD | Child Git repository | cidd | | PIDD_GIT_CHILD | Child Git repository | pidd |
| CIDD_GIT_PARENT | Parent Git repository | rwx | | PIDD_GIT_PARENT | Parent Git repository | rwx |
| CIDD_SSH_HOSTS | domain.tld ssh-type pub | | | PIDD_SSH_HOSTS | domain.tld ssh-type pub | |
| CIDD_SSH_KEY | SSH private key | | | PIDD_SSH_KEY | SSH private key | |
| CIDD_URL_ALMA | Alma repository URL | https://repo.almalinux.org | | PIDD_URL_ALMA | Alma repository URL | https://repo.almalinux.org |
| CIDD_URL_ALPINE | Alpine repository URL | https://dl-cdn.alpinelinux.org | | PIDD_URL_ALPINE | Alpine repository URL | https://dl-cdn.alpinelinux.org |
| CIDD_URL_ARCH | Arch repository URL | https://geo.mirror.pkgbuild.com | | PIDD_URL_ARCH | Arch repository URL | https://geo.mirror.pkgbuild.com |
| CIDD_URL_DEBIAN | Debian repository URL | https://deb.debian.org | | PIDD_URL_DEBIAN | Debian repository URL | https://deb.debian.org |
| CIDD_URL_FEDORA | Fedora repository URL | https://rpmfind.net | | PIDD_URL_FEDORA | Fedora repository URL | https://rpmfind.net |
| CIDD_URL_ROCKY | Rocky repository URL | https://dl.rockylinux.org | | PIDD_URL_ROCKY | Rocky repository URL | https://dl.rockylinux.org |
| CIDD_URL_UBUNTU | Ubuntu repository URL | https://ubuntu.mirrors.ovh.net | | PIDD_URL_UBUNTU | Ubuntu repository URL | https://ubuntu.mirrors.ovh.net |
## HTTPS & Python ## HTTPS & Python