From 88be2eec8261991bedb8fc09ff5eb11e44320319 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 21 Aug 2024 16:46:48 +0200 Subject: [PATCH 01/12] spcd_git_shunit,readme --- readme.md | 13 +++++++++---- spcd.sh | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index b1ea174..ea5187f 100644 --- a/readme.md +++ b/readme.md @@ -52,6 +52,7 @@ from various contexts of CA, CI and OCI / OS. | SPCD_DNS_n | Numbered name servers | 9.9.9.9 | | SPCD_GIT_MAIN | Main Git repository | spcd | | SPCD_GIT_ROOT | Root Git repository | rwx | +| SPCD_GIT_SHUNIT | ShUnit Git repository | shunit2 | | SPCD_SSH_HOSTS | domain.tld ssh-type pub | | | SPCD_SSH_KEY | SSH private key | | | SPCD_URL_ALMA | Alma repository URL | https://repo.almalinux.org | @@ -98,18 +99,18 @@ from various contexts of CA, CI and OCI / OS. ## Tasks * try git repo url variable first for shunit -* turn readme into documentation -### sh +### Shell * fit banner to text * review repositories handling for systems * opensuse * codecs repository * disable & enable https +* write function to clone git repositories * write unit tests -### sh → py +### Shell → Python * check file & variable sums * install system packages @@ -129,7 +130,7 @@ from various contexts of CA, CI and OCI / OS. * activate * relay environment module name -### py +### Python * check * .py @@ -143,3 +144,7 @@ from various contexts of CA, CI and OCI / OS. * actions * includes * write unit tests + +### Later + +* turn readme into documentation diff --git a/spcd.sh b/spcd.sh index d2fe8f7..de50ee2 100644 --- a/spcd.sh +++ b/spcd.sh @@ -8,6 +8,7 @@ [ -n "${SPCD_DNS_1}" ] || SPCD_DNS_1="9.9.9.9" [ -n "${SPCD_GIT_MAIN}" ] || SPCD_GIT_MAIN="spcd" [ -n "${SPCD_GIT_ROOT}" ] || SPCD_GIT_ROOT="rwx" +[ -n "${SPCD_GIT_SHUNIT}" ] || SPCD_GIT_SHUNIT="shunit2" [ -n "${SPCD_URL_PYTHON}" ] || SPCD_URL_PYTHON="https://pypi.org/simple" # main From 4f0a3b4eb31688ced350bef6ae55db0262676f64 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 22 Aug 2024 10:52:36 +0200 Subject: [PATCH 02/12] spcd_get_git_url --- spcd.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/spcd.sh b/spcd.sh index de50ee2..f7aec42 100644 --- a/spcd.sh +++ b/spcd.sh @@ -715,12 +715,7 @@ spcd_install_python_modules() { spcd_ipm__target="${SPCD_PYTHON_VENV_PACKAGES}" echo "→ ${spcd_ipm__root}" for spcd_ipm__repository in "${SPCD_GIT_MAIN}" "${SPCD_GIT_ROOT}"; do - case "${spcd_ipm__repository}" in - http*) spcd_ipm__url="${spcd_ipm__repository}" ;; - */*) spcd_ipm__url="${SPCD_PROJECT_ROOT}/${spcd_ipm__repository}" ;; - *) spcd_ipm__url="\ -${SPCD_PROJECT_ROOT}/${SPCD_PROJECT_PATH}/${spcd_ipm__repository}" ;; - esac + spcd_ipm__url="$(spcd_get_git_url "${spcd_ipm__repository}")" spcd_ipm__name="$(basename "${spcd_ipm__url}")" spcd_split echo "\ @@ -887,6 +882,16 @@ spcd_error_os() { exit "${SPCD_ERROR_OS}" } +spcd_get_git_url() { + if [ -n "${1}" ]; then + case "${1}" in + http*) echo "${1}" ;; + */*) echo "${SPCD_PROJECT_ROOT}/${1}" ;; + *) echo "${SPCD_PROJECT_ROOT}/${SPCD_PROJECT_PATH}/${1}" ;; + esac + fi +} + spcd_grep_os() { spcd_grep_os__variable="${1}" [ -n "${spcd_grep_os__variable}" ] && From 20438bc0e5be04f902928738e103fea93a93f69d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 22 Aug 2024 11:05:39 +0200 Subject: [PATCH 03/12] readme/refs --- readme.md | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/readme.md b/readme.md index ea5187f..3c85a10 100644 --- a/readme.md +++ b/readme.md @@ -42,29 +42,29 @@ from various contexts of CA, CI and OCI / OS. ## How -| Variable | Description | Default | -|:--------------------|:--------------------------|:--------------------------------| -| SPCD_BRANCH_RELEASE | Release deployment branch | main | -| SPCD_BRANCH_STAGING | Staging deployment branch | dev | -| SPCD_BRANCH_FEATURE | Feature deployment branch | f | -| SPCD_CA_n | Numbered CA certificates | | -| SPCD_CMD_SUM | Command to check sums | sha512sum | -| SPCD_DNS_n | Numbered name servers | 9.9.9.9 | -| SPCD_GIT_MAIN | Main Git repository | spcd | -| SPCD_GIT_ROOT | Root Git repository | rwx | -| SPCD_GIT_SHUNIT | ShUnit Git repository | shunit2 | -| SPCD_SSH_HOSTS | domain.tld ssh-type pub | | -| SPCD_SSH_KEY | SSH private key | | -| SPCD_URL_ALMA | Alma repository URL | https://repo.almalinux.org | -| SPCD_URL_ALPINE | Alpine repository URL | https://dl-cdn.alpinelinux.org | -| SPCD_URL_ARCH | Arch repository URL | https://geo.mirror.pkgbuild.com | -| SPCD_URL_DEBIAN | Debian repository URL | https://deb.debian.org | -| SPCD_URL_EPEL | EPEL repository URL | https://dl.fedoraproject.org | -| SPCD_URL_FEDORA | Fedora repository URL | https://rpmfind.net | -| SPCD_URL_OPENSUSE | OpenSUSE repository URL | https://download.opensuse.org | -| SPCD_URL_PYTHON | Python repository URL | https://pypi.org/simple | -| SPCD_URL_ROCKY | Rocky repository URL | https://dl.rockylinux.org | -| SPCD_URL_UBUNTU | Ubuntu repository URL | https://ubuntu.mirrors.ovh.net | +| Variable | Description | Default | +|:------------------|:-------------------------|:--------------------------------| +| SPCD_CA_n | Numbered CA certificates | | +| SPCD_CMD_SUM | Command to check sums | sha512sum | +| SPCD_DNS_n | Numbered name servers | 9.9.9.9 | +| SPCD_GIT_MAIN | Main Git repository | spcd | +| SPCD_GIT_ROOT | Root Git repository | rwx | +| SPCD_GIT_SHUNIT | ShUnit Git repository | shunit2 | +| SPCD_REF_FEATURE | Feature deployment ref | f | +| SPCD_REF_RELEASE | Release deployment ref | main | +| SPCD_REF_STAGING | Staging deployment ref | dev | +| SPCD_SSH_HOSTS | domain.tld ssh-type pub | | +| SPCD_SSH_KEY | SSH private key | | +| SPCD_URL_ALMA | Alma repository URL | https://repo.almalinux.org | +| SPCD_URL_ALPINE | Alpine repository URL | https://dl-cdn.alpinelinux.org | +| SPCD_URL_ARCH | Arch repository URL | https://geo.mirror.pkgbuild.com | +| SPCD_URL_DEBIAN | Debian repository URL | https://deb.debian.org | +| SPCD_URL_EPEL | EPEL repository URL | https://dl.fedoraproject.org | +| SPCD_URL_FEDORA | Fedora repository URL | https://rpmfind.net | +| SPCD_URL_OPENSUSE | OpenSUSE repository URL | https://download.opensuse.org | +| SPCD_URL_PYTHON | Python repository URL | https://pypi.org/simple | +| SPCD_URL_ROCKY | Rocky repository URL | https://dl.rockylinux.org | +| SPCD_URL_UBUNTU | Ubuntu repository URL | https://ubuntu.mirrors.ovh.net | ## Packages From af847c36fb280c3f83a7b3dcec7053682a0f2c14 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 22 Aug 2024 12:22:13 +0200 Subject: [PATCH 04/12] readme --- readme.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/readme.md b/readme.md index 3c85a10..0179e5d 100644 --- a/readme.md +++ b/readme.md @@ -1,20 +1,23 @@ # Shell to Python Continuous Deployment Get a common set of Python CI & CD commands \ -from various contexts of CA, CI and OCI / OS. +from various contexts of CA, DNS, CI and OS / OCI. ## Features -* Certification Authority certificates - * [X] custom - * [X] known -* Continuous Integration platforms +Handle project workflows with any +* network infrastructure + * [X] online + * [X] offline with custom + * [X] Certificate Authorities + * [X] Domain Name System servers +* Continuous Integration platform * [X] ForgeJo * [X] Gitea * [X] GitHub * [X] GitLab * [ ] SourceHut -* Operating Systems +* Operating System * [X] Alma * [X] 9 * [X] 8 From 7573606a4f9d816f9439e57fa017b779e1ae86f5 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 22 Aug 2024 14:35:12 +0200 Subject: [PATCH 05/12] readme/features --- readme.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index 0179e5d..7336d8e 100644 --- a/readme.md +++ b/readme.md @@ -5,19 +5,21 @@ from various contexts of CA, DNS, CI and OS / OCI. ## Features -Handle project workflows with any -* network infrastructure +Handle project workflows +* from a POSIX shell script payload in a group variable +* with a unified YAML syntax implemented in Python +* whether the network infrastructure is * [X] online * [X] offline with custom * [X] Certificate Authorities * [X] Domain Name System servers -* Continuous Integration platform +* whatever the Continuous Integration platform * [X] ForgeJo * [X] Gitea * [X] GitHub * [X] GitLab * [ ] SourceHut -* Operating System +* whatever the Operating System container * [X] Alma * [X] 9 * [X] 8 From 9629c9e85010e26b76b365dc399a2dc5f52a8a41 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 22 Aug 2024 14:38:27 +0200 Subject: [PATCH 06/12] readme/actions --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 7336d8e..67de853 100644 --- a/readme.md +++ b/readme.md @@ -7,7 +7,7 @@ from various contexts of CA, DNS, CI and OS / OCI. Handle project workflows * from a POSIX shell script payload in a group variable -* with a unified YAML syntax implemented in Python +* with a unified YAML syntax of actions implemented in Python * whether the network infrastructure is * [X] online * [X] offline with custom From 0d881993028e21b821ea955e74db99e09dcd68de Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 22 Aug 2024 14:59:27 +0200 Subject: [PATCH 07/12] readme/why --- readme.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 67de853..28823bf 100644 --- a/readme.md +++ b/readme.md @@ -3,7 +3,18 @@ Get a common set of Python CI & CD commands \ from various contexts of CA, DNS, CI and OS / OCI. -## Features +## Why + +Project workflows can occur in: +* an online or offline context, dealing with custom CA & DNS servers +* various Continuous Integration platforms, with different workflow syntaxes +* specific Operating Systems, having different sets of commands and packages +* specific containers for JavaScript based actions (ForgeJo, Gitea, GitHub) +What if there was a unified way to do so? + +## How + +## What Handle project workflows * from a POSIX shell script payload in a group variable @@ -45,6 +56,8 @@ Handle project workflows * [X] Noble (24.04) * [ ] Jammy (22.04) +## Who + ## How | Variable | Description | Default | From ca347bd626b4fc6206a88cf879ad9af61b373bc3 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 22 Aug 2024 16:14:42 +0200 Subject: [PATCH 08/12] readme/how --- readme.md | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index 28823bf..aec04ea 100644 --- a/readme.md +++ b/readme.md @@ -14,11 +14,34 @@ What if there was a unified way to do so? ## How +Picture it… + +### Group environment variables + +* numbered + * Certificate Authority armored certificates + * Domain Name System servers IP addresses +* set group environment variables for + * ref names for deployment contexts of feature, staging & release + * alternate locations of + * Git repositories of this project & its parent framework + * Operating Systems & Software packages + * SSH key & hosts for deployments + * a standalone POSIX shell script payload + +### Workflow files + +* calling the POSIX shell script payload as their very first step +* using a unified YAML syntax made of actions implemented in Python + +### Continous Integration & Deployment + +* configuring the Operating System container +* installing Python system & virtual environments + ## What -Handle project workflows -* from a POSIX shell script payload in a group variable -* with a unified YAML syntax of actions implemented in Python +Handle project workflows: * whether the network infrastructure is * [X] online * [X] offline with custom From 6bbb083040266f55105891860d2aa7d818e95c05 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 22 Aug 2024 16:22:36 +0200 Subject: [PATCH 09/12] readme/what --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index aec04ea..ba6adcc 100644 --- a/readme.md +++ b/readme.md @@ -41,7 +41,7 @@ Picture it… ## What -Handle project workflows: +Handle project workflows in a unified way: * whether the network infrastructure is * [X] online * [X] offline with custom From 7e3b55c6c46fa500f6d733b5ce10ad14b82ce15a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 22 Aug 2024 16:29:08 +0200 Subject: [PATCH 10/12] readme/what,when --- readme.md | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/readme.md b/readme.md index ba6adcc..106555f 100644 --- a/readme.md +++ b/readme.md @@ -41,6 +41,8 @@ Picture it… ## What +### Features + Handle project workflows in a unified way: * whether the network infrastructure is * [X] online @@ -79,9 +81,7 @@ Handle project workflows in a unified way: * [X] Noble (24.04) * [ ] Jammy (22.04) -## Who - -## How +### Environment variables | Variable | Description | Default | |:------------------|:-------------------------|:--------------------------------| @@ -107,9 +107,9 @@ Handle project workflows in a unified way: | SPCD_URL_ROCKY | Rocky repository URL | https://dl.rockylinux.org | | SPCD_URL_UBUNTU | Ubuntu repository URL | https://ubuntu.mirrors.ovh.net | -## Packages +### Operating Systems containers -### Latest +#### Latest | os | https | updt-ca | python | graphviz | plantuml | shellcheck | shunit | shfmt | |:----------------|---|---|------------:|------:|-----------:|------:|------:|-----:| @@ -121,7 +121,7 @@ Handle project workflows in a unified way: | Ubuntu Noble | ☐ | ☐ | 3.12 | u2.42 | u1.2020.2 | u0.9 | 2.1.8 | u3.8 | | Alma / Rocky 9 | ☑ | ☑ | 3.9 → 3.12 | 2.44 | e1.2024.6 | e0.8 | git | | -### Previous +#### Previous | os | https | updt-ca | python | graphviz | plantuml | shellcheck | shunit | shfmt | |:----------------|---|---|------------:|------:|-----------:|------:|------:|-----:| @@ -130,14 +130,24 @@ Handle project workflows in a unified way: | OpenSUSE 15.5 | ☐ | ☑ | 3.6 → 3.11 | 2.48 | 1.2020.9 | 0.8 | 2.1.6 | 3.5 | | Alma / Rocky 8 | ☑ | ☑ | 3.6 → 3.12 | 2.40 | e1.2024.6 | e0.6 | git | | -### Older Python +#### Older Python | os | https | updt-ca | python | graphviz | plantuml | shellcheck | shunit | shfmt | |:----------------|---|---|------------:|------:|-----------:|------:|------:|-----:| | Ubuntu Jammy | ☐ | ☐ | 3.10 | u2.42 | u1.2020.2 | u0.8 | 2.1.6 | u3.4 | | Debian Bullseye | ☐ | ☐ | 3.9 | 2.42 | 1.2020.2 | 0.7 | 2.1.6 | | -## Tasks +## Who + +… + +## Where + +… + +## When + +### First * try git repo url variable first for shunit From 927ef58dcc4a19debf8623f5b33fda4815315bbd Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 22 Aug 2024 20:37:24 +0200 Subject: [PATCH 11/12] readme/where --- readme.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 106555f..97d933b 100644 --- a/readme.md +++ b/readme.md @@ -143,7 +143,12 @@ Handle project workflows in a unified way: ## Where -… +* [Discord](https://discord.com/channels/983145051985154108/1255894420092485652) +* [IRC](ircs://irc.libera.chat/#spcd) +* [Web](https://spcd.rwx.work) + * [Git](https://forge.rwx.work/rwx.work/spcd) + * [RSS](https://forge.rwx.work/rwx.work/spcd.rss) + * [Workflows](https://forge.rwx.work/rwx.work/spcd/actions) ## When From 689aef265539ac0e3a1d32f0167f6f7377e97770 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 22 Aug 2024 21:08:14 +0200 Subject: [PATCH 12/12] readme/who --- readme.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 97d933b..ead54b5 100644 --- a/readme.md +++ b/readme.md @@ -139,7 +139,13 @@ Handle project workflows in a unified way: ## Who -… +### By + +[Marc Beninca](https://marc.beninca.link). + +### For + +People feeling the need to aim for consistence in the CI & CD universe. ## Where