Files
infrastructure/docs/08-PHASE7-GITEA-GITOPS.md
jazzymc 62a6267026
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Add infrastructure documentation
2026-01-18 16:57:25 +02:00

169 lines
3.5 KiB
Markdown

# Phase 7: Gitea + Woodpecker CI (GitOps for Homelab)
## Status: ✅ COMPLETED
**Deployed:** 2026-01-18
---
## Deployed Components
| Service | Container | Version | Port | URL | Status |
|---------|-----------|---------|------|-----|--------|
| Gitea | gitea | 1.25.3 | 3005→3000, 2222→22 | https://git.xtrm-lab.org | ✅ Running |
| Woodpecker Server | woodpecker-server | 3.13.0 | 8008→8000 | https://ci.xtrm-lab.org | ✅ Running |
| Woodpecker Agent | woodpecker-agent | 3.13.0 | - | - | ✅ Running |
---
## Configuration
### Gitea
| Parameter | Value |
|-----------|-------|
| Admin User | jazzymc |
| Database | PostgreSQL (gitea_db @ 172.18.0.13) |
| DB User | gitea |
| SSH Port | 2222 |
| Data Path | /mnt/user/appdata/gitea/data |
| Network | dockerproxy |
### Woodpecker CI
| Parameter | Value |
|-----------|-------|
| Version | 3.13.0 |
| Admin User | jazzymc (via Gitea OAuth) |
| Server IP | 172.18.0.134 |
| gRPC Port | 9000 |
| HTTP Port | 8000 (mapped to 8008) |
| Max Workflows | 2 (parallel) |
| Data Path | /mnt/user/appdata/woodpecker/server |
| Agent Secret | 564a5716400532874a8e02313a491b4f3864ce9b77a5122ce0eb14777749e740 |
### Gitea OAuth App (for Woodpecker)
| Parameter | Value |
|-----------|-------|
| Client ID | 924b3300-b607-4a48-bc26-35b06dbf18c7 |
| Redirect URI | https://ci.xtrm-lab.org/authorize |
---
## Network Configuration
All services on `dockerproxy` network:
| Service | Internal IP | DNS Name |
|---------|-------------|----------|
| Gitea | Dynamic | gitea |
| Woodpecker Server | 172.18.0.134 | woodpecker-server |
| PostgreSQL | 172.18.0.13 | postgresql17 |
### Traefik Routes
| Domain | Service | Port |
|--------|---------|------|
| git.xtrm-lab.org | gitea | 3000 |
| ci.xtrm-lab.org | woodpecker-server | 8000 |
---
## Verification Checklist
- [x] Gitea container running
- [x] Gitea accessible at https://git.xtrm-lab.org
- [x] Admin account created (jazzymc)
- [x] OAuth app created for Woodpecker
- [x] Woodpecker Server v3.13.0 running
- [x] Woodpecker Agent v3.13.0 running and connected
- [x] Woodpecker accessible at https://ci.xtrm-lab.org
- [x] Gitea OAuth login working
- [x] CI pipeline tested successfully
---
## Usage
### Git Operations
```bash
# Clone via HTTPS
git clone https://git.xtrm-lab.org/jazzymc/infrastructure.git
# Clone via SSH (port 2222)
git clone ssh://git@git.xtrm-lab.org:2222/jazzymc/infrastructure.git
```
### CI Pipeline (.woodpecker.yml)
```yaml
steps:
- name: test
image: alpine
commands:
- echo 'Hello from Woodpecker CI!'
- date
```
### Example: Node.js Pipeline
```yaml
steps:
- name: install
image: node:20
commands:
- npm install
- name: test
image: node:20
commands:
- npm test
- name: build
image: node:20
commands:
- npm run build
when:
branch: main
```
### Example: Docker Build
```yaml
steps:
- name: build
image: docker
commands:
- docker build -t myapp .
volumes:
- /var/run/docker.sock:/var/run/docker.sock
```
---
## Maintenance
### Update Woodpecker
```bash
docker pull woodpeckerci/woodpecker-server:v3
docker pull woodpeckerci/woodpecker-agent:v3
docker restart woodpecker-server woodpecker-agent
```
### Backup
Important paths to backup:
- /mnt/user/appdata/gitea/data
- /mnt/user/appdata/woodpecker/server
- PostgreSQL database: gitea_db
---
## Related Documents
- [00-CURRENT-STATE.md](./00-CURRENT-STATE.md) - Infrastructure overview
- [03-PHASE3-AUTHENTIK-ZEROTRUST.md](./03-PHASE3-AUTHENTIK-ZEROTRUST.md) - SSO setup