diff --git a/README.md b/README.md index 820775d..00bf0c4 100644 --- a/README.md +++ b/README.md @@ -190,9 +190,9 @@ All packaging builds and integration tests run inside clean Podman containers: ## Documentation -- [User Guide](docs/user-guide.md): Comprehensive instructions for operators and desktop users. -- [Administrator Guide](docs/admin-guide.md): Automation, cron/systemd configuration, monitoring, and logrotate setup. -- [Developer Guide](docs/developer-guide.md): Internal architecture, adding new package managers, and test development. +- [User Guide](docs/user-guide.md): Comprehensive instructions for operators and desktop users (selective updates, filtering, security-only, Flatpak, shell completion). +- [Administrator Guide](docs/admin-guide.md): Automation, cron/systemd configuration, monitoring, logrotate setup, and Gitea Package Registry integration (RPM & Debian). +- [Developer Guide](docs/developer-guide.md): Internal architecture, adding package managers, test development, packaging, and Gitea Actions CI/CD release workflow. - [MAN Page (Section 8)](man/linux-updater.8): System administration manual (`man 8 linux-updater`). --- diff --git a/docs/admin-guide.md b/docs/admin-guide.md index 03bd8b4..84addfd 100644 --- a/docs/admin-guide.md +++ b/docs/admin-guide.md @@ -224,3 +224,53 @@ linux-updater completion bash > /etc/bash_completion.d/linux-updater # Zsh: linux-updater completion zsh > /usr/local/share/zsh/site-functions/_linux-updater ``` + +--- + +## 6. Gitea Package Registry Integration (Homelab Repositories) + +In enterprise homelab environments with centralized package management, `linux-updater` can be distributed and continuously updated across all fleet hosts via the self-hosted Gitea Package Registry at `https://gitea.wired.synology.me`. + +### A. RHEL / AlmaLinux / Rocky / Fedora Clients (`DNF` / `YUM`) + +Create the repository configuration file `/etc/yum.repos.d/gitea-wired.repo`: + +```ini +[gitea-wired] +name=Wired LAB Gitea RPM Repository +baseurl=https://gitea.wired.synology.me/api/packages/soda64/rpm +enabled=1 +gpgcheck=0 +``` + +Verify and install via DNF: +```bash +sudo dnf clean all +sudo dnf makecache +sudo dnf install -y linux-updater +``` + +### B. Debian / Ubuntu Clients (`APT`) + +Import the repository signing key and configure the APT source list `/etc/apt/sources.list.d/gitea-wired.list`: + +```bash +# Import Gitea Debian repository key: +curl -fsSL https://gitea.wired.synology.me/api/packages/soda64/debian/repository.key | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/gitea-wired.gpg + +# Add repository source entry: +echo "deb [signed-by=/etc/apt/trusted.gpg.d/gitea-wired.gpg] https://gitea.wired.synology.me/api/packages/soda64/debian stable main" | sudo tee /etc/apt/sources.list.d/gitea-wired.list + +# Update package cache and install: +sudo apt update +sudo apt install -y linux-updater +``` + +### C. Fleet Upgrades via Gitea Package Registry + +Once configured on fleet machines, routine updates executed by `linux-updater` itself or system package managers will automatically pull new releases of `linux-updater` alongside system packages: + +```bash +# Automated routine update includes linux-updater package upgrades: +sudo linux-updater update -y +``` diff --git a/docs/developer-guide.md b/docs/developer-guide.md index 054ad42..f99443d 100644 --- a/docs/developer-guide.md +++ b/docs/developer-guide.md @@ -154,3 +154,41 @@ Generated artifacts: - `dist/linux-updater-2.0.0.tar.gz`: Standalone distribution archive containing `install.sh`. - `dist/linux-updater_2.0.0_all.deb`: Native Debian/Ubuntu binary package. - `dist/rpm/RPMS/noarch/linux-updater-2.0.0-1.*.noarch.rpm`: Native RPM package. + +--- + +## 6. CI/CD Pipeline & Automated Release Workflow (Gitea Actions) + +`linux-updater` incorporates an automated CI/CD pipeline defined in `.gitea/workflows/release.yml`. + +### A. Pipeline Architecture & Execution Environment +- **Runner Host:** VM `giteaworker` on Synology NAS (`192.168.11.2`), running Fedora with `act_runner` in `hostexecutor` mode. +- **Workflow Tag:** `runs-on: fedora`. +- **Triggers:** + - Pushing any semantic version tag matching `v*` (e.g. `v2.0.0`). + - Manual execution via Gitea Web UI or `tea` CLI (`workflow_dispatch`). + +### B. Pipeline Stages + +```mermaid +flowchart TD + A["Push Tag v* / Dispatch"] --> B["Checkout & Verify Environment (rpmbuild, python3)"] + B --> C["Run Unit Test Suite (python3 -m unittest discover tests)"] + C --> D["Build Distribution Packages (build_packages.py)"] + D --> E["Upload to Gitea Package Registry (RPM & Debian)"] + D --> F["Attach Artifacts to Gitea Release (API /releases)"] + E --> G["Link Packages to Repository (API /packages/.../link)"] +``` + +1. **Environment Verification:** Verifies Python 3 runtime and ensures `rpmbuild` is installed on the runner. +2. **Quality Gate:** Runs full unit test suite (`python3 -m unittest discover tests`). Any test regression immediately aborts the pipeline. +3. **Package Compilation:** Invokes `packaging/build_packages.py` to produce native `.deb`, `.rpm`, and `.tar.gz` packages in `dist/`. +4. **Publishing to Gitea Package Registry:** + - RPM: `PUT /api/packages/soda64/rpm/upload` + - Debian: `PUT /api/packages/soda64/debian/pool/stable/main/upload` + - Links the uploaded packages to the `linux-updater` repository via `POST /api/v1/packages/soda64//linux-updater/-/link/linux-updater`. + - **Secret Requirement:** The upload requires a personal access token with `package:write` scope stored in repository secrets as `PACKAGES_GENERATION`. +5. **Gitea Release & Asset Attachment:** + - Queries or creates the Gitea Release corresponding to tag `vX.Y.Z`. + - Idempotently purges older assets on re-runs to prevent duplicated attachments. + - Uploads binary artifacts (`.tar.gz`, `.deb`, `.rpm`) as downloadable Release Assets for operators.