spcd/readme.md

284 lines
8.7 KiB
Markdown
Raw Normal View History

2024-06-27 13:54:46 +02:00
# Shell to Python Continuous Deployment
2024-04-29 13:04:36 +02:00
2024-08-23 07:57:45 +02:00
Get a common set of Python based CI / CD commands\
2024-08-22 12:22:13 +02:00
from various contexts of CA, DNS, CI and OS / OCI.
2024-05-03 15:11:58 +02:00
2024-08-22 21:42:46 +02:00
---
2024-08-22 14:59:27 +02:00
## 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
2024-08-23 07:57:45 +02:00
* specific Operating Systems, having different commands and package names
2024-08-22 14:59:27 +02:00
* specific containers for JavaScript based actions (ForgeJo, Gitea, GitHub)
2024-08-22 21:25:35 +02:00
2024-08-22 14:59:27 +02:00
What if there was a unified way to do so?
2024-08-22 21:42:46 +02:00
---
2024-08-22 14:59:27 +02:00
## How
2024-08-22 16:14:42 +02:00
Picture it…
### Group environment variables
* numbered
* Certificate Authority armored certificates
* Domain Name System servers IP addresses
2024-08-23 07:57:45 +02:00
* ref names for deployment contexts of feature, staging & release
* alternate locations of
* Operating Systems & Software packages
2024-08-23 14:49:38 +02:00
* Git repositories of
* this project
* its parent framework
* projects not available in some distributions
* shunit2
2024-08-23 07:57:45 +02:00
* SSH key & hosts for deployments
* a standalone POSIX shell script payload
2024-08-22 16:14:42 +02:00
### Workflow files
* calling the POSIX shell script payload as their very first step
* using a unified YAML syntax made of actions implemented in Python
2024-08-23 07:57:45 +02:00
### Integration & Deployment
2024-08-22 16:14:42 +02:00
2024-08-23 14:49:38 +02:00
#### Shell
2024-08-23 15:06:50 +02:00
* [X] setting up the chosen Operating System container
* [X] Domain Name System resolving
* [X] package manager configuration & repositories
* [X] Certificate Authorities trusting
* [X] Operating System updating
* [X] installing Git to clone
* [X] this project
* [X] its parent framework
2024-11-07 22:34:26 +01:00
* [X] installing Python
2024-08-23 15:06:50 +02:00
* [X] system environment
* [X] virtual environment
2024-11-07 22:34:26 +01:00
* [ ] managed version
2024-08-23 15:06:50 +02:00
* [X] generating a Python module to switch context
2024-08-23 14:49:38 +02:00
#### Python
2024-08-23 15:06:50 +02:00
* [X] setting up an OpenSSH client
* [X] known hosts
* [ ] private key
* [ ] and finally parsing commands from
* [X] system
* [ ] workflow
* [ ] to run available actions
* [ ] check project
* [ ] build project
* [X] browse workspace
* [ ] synchronize
2024-08-22 16:14:42 +02:00
2024-08-22 21:42:46 +02:00
---
2024-08-22 14:59:27 +02:00
## What
2024-04-29 13:04:36 +02:00
2024-08-22 16:29:08 +02:00
### Features
2024-08-23 14:49:38 +02:00
Handle project workflows in a unified way:
2024-08-22 21:49:38 +02:00
2024-08-22 14:35:12 +02:00
* whether the network infrastructure is
2024-08-22 12:22:13 +02:00
* [X] online
* [X] offline with custom
* [X] Certificate Authorities
* [X] Domain Name System servers
2024-08-22 21:49:38 +02:00
2024-08-22 14:35:12 +02:00
* whatever the Continuous Integration platform
2024-06-14 10:02:31 +02:00
* [X] ForgeJo
2024-06-17 21:44:22 +02:00
* [X] Gitea
* [X] GitHub
2024-05-05 22:20:49 +02:00
* [X] GitLab
* [ ] SourceHut
2024-08-22 21:49:38 +02:00
2024-08-22 14:35:12 +02:00
* whatever the Operating System container
2024-11-08 04:59:10 +01:00
| System | Latest | Previous |
|:---------|:---------------------------|:---------------------------|
| Alma | * [X] 9 | * [X] 8 |
| Alpine | * [X] 3.20 | * [X] 3.19 |
| Arch | * [X] 20240818 (.0.255804) | * [X] 20240101 (.0.204074) |
| Debian | * [X] Bookworm (12) | * [ ] Bullseye (11) |
| Fedora | * [X] 40 | * [X] 39 |
| OpenSUSE | * [ ] 15.6 | * [ ] 15.5 |
| Rocky | * [X] 9 | * [X] 8 |
| Ubuntu | * [X] Noble (24.04) | * [ ] Jammy (22.04) |
2024-04-29 13:04:36 +02:00
2024-08-22 16:29:08 +02:00
### Environment variables
2024-05-02 10:58:02 +02:00
2024-08-22 11:05:39 +02:00
| Variable | Description | Default |
|:------------------|:-------------------------|:--------------------------------|
| SPCD_CA_n | Numbered CA certificates | |
| SPCD_DNS_n | Numbered name servers | 9.9.9.9 |
2024-08-28 08:49:44 +02:00
| SPCD_GIT_RWX | RWX Git repository | rwx |
2024-08-22 11:05:39 +02:00
| SPCD_GIT_SHUNIT | ShUnit Git repository | shunit2 |
2024-08-28 08:48:24 +02:00
| SPCD_GIT_SPCD | SPCD Git repository | spcd |
2024-08-22 11:05:39 +02:00
| 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 | |
2024-08-30 22:57:57 +02:00
| SPCD_TXT_LOCALE | Locale to use for text | en_US |
2024-08-22 11:05:39 +02:00
| 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 |
2024-09-01 02:58:26 +02:00
| SPCD_URL_PYTHON | Python repository URL | https://pypi.org |
2024-08-22 11:05:39 +02:00
| SPCD_URL_ROCKY | Rocky repository URL | https://dl.rockylinux.org |
| SPCD_URL_UBUNTU | Ubuntu repository URL | https://ubuntu.mirrors.ovh.net |
2024-05-02 10:58:02 +02:00
2024-08-22 16:29:08 +02:00
### Operating Systems containers
2024-05-10 22:25:17 +02:00
2024-08-22 16:29:08 +02:00
#### Latest
2024-08-20 19:46:33 +02:00
2024-11-08 10:40:29 +01:00
| os | https | up ca | python | ffmpeg | gource | graphviz | plantuml | shellcheck | shfmt | shunit |
|:----------------|---|---|------------:|-------:|-----:|------:|-----------:|------:|-----:|------:|
| Arch 20240818 | ☑ | ☑ | 3.12 | 7.0.2 | 0.54 | 12.0 | 1.2023.13 | 0.10 | 3.8 | 2.1.8 |
| Alpine 3.20 | ☑ | ☐ | 3.12 | 6.1.1 | 0.54 | 9.0 | 1.2024.4 | 0.10 | 3.8 | 2.1.8 |
| Fedora 40 | ☑ | ☑ | 3.12 → 3.13 | 6.1.2 | 0.55 | 9.0 | 1.2024.6 | 0.9 | 3.7 | 2.1.6 |
| Debian Bookworm | ☐ | ☐ | 3.11 | 5.1.6 | 0.54 | 2.42 | 1.2020.2 | 0.9 | 3.6 | 2.1.8 |
| OpenSUSE 15.6 | ☐ | ☑ | 3.6 → 3.12 | 4.4.4 | 0.54 | 2.48 | 1.2020.9 | 0.8 | 3.5 | 2.1.6 |
| Ubuntu Noble | ☐ | ☐ | 3.12 | 6.1.1 | 0.54 | u2.42 | u1.2020.2 | u0.9 | u3.8 | 2.1.8 |
| Alma / Rocky 9 | ☑ | ☑ | 3.9 → 3.12 | e5.1.4 | | 2.44 | e1.2024.6 | e0.8 | | |
2024-08-20 19:46:33 +02:00
2024-08-22 16:29:08 +02:00
#### Previous
2024-08-20 19:46:33 +02:00
2024-11-08 10:40:29 +01:00
| os | https | up ca | python | ffmpeg | gource | graphviz | plantuml | shellcheck | shfmt | shunit |
|:----------------|---|---|------------:|-------:|-----:|------:|-----------:|------:|-----:|------:|
| Alpine 3.19 | ☑ | ☐ | 3.11 | 6.1.1 | 0.54 | 9.0 | 1.2023.12 | 0.9 | 3.7 | 2.1.8 |
| Fedora 39 | ☑ | ☑ | 3.12 → 3.13 | 6.1.1 | 0.55 | 8.1 | 1.2024.6 | 0.9 | 3.5 | 2.1.6 |
| OpenSUSE 15.5 | ☐ | ☑ | 3.6 → 3.11 | 4.4.4 | 0.54 | 2.48 | 1.2020.9 | 0.8 | 3.5 | 2.1.6 |
| Alma / Rocky 8 | ☑ | ☑ | 3.6 → 3.12 | | | 2.40 | e1.2024.6 | e0.6 | | |
2024-08-20 19:46:33 +02:00
2024-08-22 16:29:08 +02:00
#### Older Python
2024-08-20 19:46:33 +02:00
2024-11-08 10:40:29 +01:00
| os | https | up ca | python | ffmpeg | gource | graphviz | plantuml | shellcheck | shfmt | shunit |
|:----------------|---|---|------------:|-------:|-----:|------:|-----------:|------:|-----:|------:|
| Ubuntu Jammy | ☐ | ☐ | 3.10 | 4.4.2 | 0.51 | u2.42 | u1.2020.2 | u0.8 | u3.4 | 2.1.6 |
| Debian Bullseye | ☐ | ☐ | 3.9 | 4.3.7 | 0.51 | 2.42 | 1.2020.2 | 0.7 | | 2.1.6 |
2024-05-10 22:25:17 +02:00
2024-08-22 21:42:46 +02:00
---
2024-08-22 16:29:08 +02:00
## Who
2024-08-22 22:03:22 +02:00
### By
2024-08-22 21:08:14 +02:00
2024-08-22 22:03:22 +02:00
* [Marc Beninca](https://marc.beninca.link)
### For
2024-08-23 09:38:34 +02:00
* People feeling the need to aim for consistency in the CI / CD universe
2024-08-22 16:29:08 +02:00
2024-08-22 21:42:46 +02:00
---
2024-08-22 16:29:08 +02:00
## Where
2024-08-22 22:03:22 +02:00
### Chat
2024-08-22 20:37:24 +02:00
* [Discord](https://discord.com/channels/983145051985154108/1255894420092485652)
* [IRC](ircs://irc.libera.chat/#spcd)
2024-08-22 22:03:22 +02:00
### Forge
* [Repository](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)
### Deployment
* [Site](https://spcd.rwx.work)
2024-08-22 16:29:08 +02:00
2024-08-22 21:42:46 +02:00
---
2024-08-22 16:29:08 +02:00
## When
2024-08-27 11:47:42 +02:00
### Tasks for a 1st stable release
2024-08-28 08:45:31 +02:00
#### Documentation
* build instead of readme
* generate graphs
2024-09-07 00:50:54 +02:00
* list behavior differences
* Continuous Integration platforms
* Operating Systems
2024-08-28 08:45:31 +02:00
2024-08-27 11:47:42 +02:00
#### Shell
2024-08-19 14:27:10 +02:00
2024-08-23 17:03:22 +02:00
* comment
2024-09-11 23:34:58 +02:00
* git/pypi fallback for rwx/spcd
2024-08-27 12:08:08 +02:00
* handle errors
2024-08-26 12:43:03 +02:00
* packages
* configure
* apk
* pacman
* zypper
* repositories
2024-09-01 21:02:20 +02:00
* codecs
* epel
* fedora
* opensuse
2024-08-26 12:43:03 +02:00
* opensuse
* disable & enable https
2024-09-05 11:26:32 +02:00
* locales
* persist
2024-08-25 06:58:12 +02:00
* test
2024-09-08 20:54:37 +02:00
* workspace variable
2024-08-19 14:27:10 +02:00
2024-08-27 11:47:42 +02:00
#### Shell → Python
2024-08-19 14:27:10 +02:00
* check file & variable sums
2024-08-19 14:43:46 +02:00
* install system packages
* epel
* plantuml
* shellcheck
* graphviz
* openssh
* rsync
* shfmt
2024-08-21 12:38:38 +02:00
* shunit
2024-08-19 14:38:39 +02:00
* python virtual environment
* install system package
* configure pip
* venv
* create
* activate
2024-08-31 09:31:41 +02:00
* query package
2024-08-20 14:04:17 +02:00
* relay environment module name
2024-08-19 14:27:10 +02:00
2024-08-27 11:47:42 +02:00
#### Python
2024-06-14 09:16:28 +02:00
2024-08-19 20:33:11 +02:00
* check
2024-06-14 11:59:10 +02:00
* .py
* .sh
2024-08-20 14:04:17 +02:00
* maximum line length
2024-08-25 06:58:12 +02:00
* comment
2024-08-20 14:04:17 +02:00
* detect ssh private key type
2024-08-21 12:38:38 +02:00
* fit banner to text
2024-08-21 10:49:40 +02:00
* implement substeps
2024-08-20 14:04:17 +02:00
* list sys.path
* set workflow templates
* actions
* includes
2024-08-23 17:01:05 +02:00
* try git repo url variable first for shunit
2024-08-25 06:58:12 +02:00
* test
2024-08-21 16:46:48 +02:00
2024-08-27 11:47:42 +02:00
### Task stack
2024-08-21 16:46:48 +02:00
2024-08-23 07:57:45 +02:00
* automate versions fetching
2024-09-08 15:06:48 +02:00
* gource, xvfb, xauth
2024-08-27 23:14:35 +02:00
* handle openh264 repositories
2024-09-15 22:44:49 +02:00
* link from workspace to actions root
2024-09-10 10:14:22 +02:00
* rpm fusion
2024-09-01 16:10:17 +02:00
* tex
2024-08-29 16:22:14 +02:00
* translate to french
2024-11-12 12:53:06 +01:00
* try to support
* guix
* nix
2024-10-08 16:17:14 +02:00
* uv