CI/CD pipeline and test/prod environments #3

Open
opened 2026-02-26 23:53:03 +01:00 by timothy · 0 comments
Owner

Overview

Set up automated Docker image builds and separate test/prod environments so code changes can be validated before going live.

Depends on: server-management#172 (Gitea Actions runner setup)

1. CI Workflow

.gitea/workflows/build.yml:

  • Trigger on push to main
  • Build Docker image using existing docker/Dockerfile
  • Tag as ersatztv:latest and ersatztv:<commit-sha>
  • Push to container registry (Gitea packages or local registry)
  • Optionally run dotnet test before building

Note: The Dockerfile uses a custom FFmpeg base image from ghcr.io/ersatztv/ersatztv-ffmpeg:7.1.1. We may need to mirror this to our registry or fork it too if GHCR access becomes unreliable.

2. Test Environment

Separate ErsatzTV container on jazz for validating changes before prod:

Prod Test
Container ersatztv ersatztv-test
Port 8409 8410
Config ~/downloadswarm/ersatztv/ ~/downloadswarm/ersatztv-test/
DB ersatztv.sqlite3 ersatztv-test.sqlite3
Image ersatztv:prod ersatztv:latest
Jellyfin Connected (live channels) Not connected

The test instance should:

  • Have its own copy of the config/DB (snapshot from prod initially)
  • NOT be connected to Jellyfin as a tuner (to avoid ghost channels)
  • Share the same media volume mounts (read-only) so it can test playback
  • Be accessible via a different port for manual testing

3. Deployment Flow

code push → Gitea Actions builds image → test container auto-updates
                                        ↓ (manual promotion)
                                        prod container updated

For prod promotion, either:

  • Manual: docker pull ersatztv:latest && docker tag ersatztv:latest ersatztv:prod && docker restart ersatztv
  • Git tag: pushing a v* tag builds and tags as :prod, auto-restarts prod container via webhook/watchtower

4. Open Questions

  • Should we use Watchtower for auto-updates or keep it manual?
  • Do we need a staging Jellyfin tuner pointing at the test instance for full E2E testing?
  • Should the test DB be a periodic copy of prod, or start fresh each time?
## Overview Set up automated Docker image builds and separate test/prod environments so code changes can be validated before going live. Depends on: server-management#172 (Gitea Actions runner setup) ## 1. CI Workflow `.gitea/workflows/build.yml`: - Trigger on push to `main` - Build Docker image using existing `docker/Dockerfile` - Tag as `ersatztv:latest` and `ersatztv:<commit-sha>` - Push to container registry (Gitea packages or local registry) - Optionally run `dotnet test` before building Note: The Dockerfile uses a custom FFmpeg base image from `ghcr.io/ersatztv/ersatztv-ffmpeg:7.1.1`. We may need to mirror this to our registry or fork it too if GHCR access becomes unreliable. ## 2. Test Environment Separate ErsatzTV container on jazz for validating changes before prod: | | Prod | Test | |---|---|---| | Container | `ersatztv` | `ersatztv-test` | | Port | 8409 | 8410 | | Config | `~/downloadswarm/ersatztv/` | `~/downloadswarm/ersatztv-test/` | | DB | `ersatztv.sqlite3` | `ersatztv-test.sqlite3` | | Image | `ersatztv:prod` | `ersatztv:latest` | | Jellyfin | Connected (live channels) | Not connected | The test instance should: - Have its own copy of the config/DB (snapshot from prod initially) - NOT be connected to Jellyfin as a tuner (to avoid ghost channels) - Share the same media volume mounts (read-only) so it can test playback - Be accessible via a different port for manual testing ## 3. Deployment Flow ``` code push → Gitea Actions builds image → test container auto-updates ↓ (manual promotion) prod container updated ``` For prod promotion, either: - **Manual**: `docker pull ersatztv:latest && docker tag ersatztv:latest ersatztv:prod && docker restart ersatztv` - **Git tag**: pushing a `v*` tag builds and tags as `:prod`, auto-restarts prod container via webhook/watchtower ## 4. Open Questions - Should we use Watchtower for auto-updates or keep it manual? - Do we need a staging Jellyfin tuner pointing at the test instance for full E2E testing? - Should the test DB be a periodic copy of prod, or start fresh each time?
timothy added the ci-cdenhancementpriority: medium labels 2026-03-08 23:02:35 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: timothy/ersatztv#3