docs: document Gitea package registry client config and CI/CD workflow
Build and Publish Release / Build Packages and Publish (push) Successful in 26s
Build and Publish Release / Build Packages and Publish (push) Successful in 26s
This commit is contained in:
1 parent
8bec4ed932
commit
97c6ac2ab9
3 files changed
+91
-3
No files matched your search
@@ -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
|
||||
```
|
||||
@@ -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/<type>/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.
|
||||
Reference in new issue
Block a user