Login

Deployment

This document describes the system architecture, service configuration, and the automated software deployment process.

Architecture Overview

The system provides a complete hosting and CI/CD environment for software projects. It uses Docker Compose to orchestrate infrastructure for version control, continuous integration, and web hosting.

Key Components

Service Image Role
Traefik traefik:latest Edge router / reverse proxy. Handles routing based on Host headers and exposes services on port 80/8080.
Gitea gitea/gitea:latest Self-hosted Git service for source code management.
Woodpecker Server woodpeckerci/woodpecker-server CI/CD server that integrates with Gitea to automate builds and deployments.
Woodpecker Agent woodpeckerci/woodpecker-agent Runs the actual CI pipeline steps; mounts the Docker socket and the shared softwares volume.
MySQL mysql:8 Primary database (softwares) for the API, storing software metadata and release information.
phpMyAdmin phpmyadmin:latest Web UI for inspecting and managing the MySQL database.
API (Local Build) The backend Ruby on Rails 8 application that serves the catalog REST API, file downloads, the ActiveAdmin panel, and the /update endpoint. Routed for the /api, /file, /update, and /admin path prefixes and for the games.teletype.hu host.
Frontend (Local Build) The user-facing Vue 3 / Vite single-page application serving the game portal.
Droparea linuxserver/openssh-server A secure SSH gateway for CI/CD runners to upload compiled artifacts.

Shared Storage & Data Flow

A critical part of the system is how files move from the CI runner to the web application:

  1. Droparea Volume: Mounts ./data/softwares to /home/drop.
  2. API Volume: Mounts ./data/softwares to /softwares.

Because they share the same physical directory on the host, any file uploaded via SSH to droparea is immediately visible to the api.

Deployment Workflow (Woodpecker CI)

The deployment process consists of two main steps defined in .woodpecker.yaml:

1. Artifact Upload (artifact step)

The CI runner compiles the software and uploads the resulting files to the Droparea service using SSH/SCP.

  • Tools: openssh-client, sshpass.
  • Target: DROPAREA_HOST (port 2222 in compose, 2223 in example).
  • Result: Files are placed in the shared storage directory.

2. Software Update (update step)

After the files are uploaded, the CI runner notifies the API to register the new version.

  • Method: HTTP GET request to the /update endpoint.
  • Parameters: platform, name, version, and a shared UPDATE_SECRET.
  • Command: curl "${UPDATE_SERVER}/update?platform=...&name=...&version=...&secret=${UPDATE_SECRET}"

3. Visibility

Once the update is processed, the new softwares and their corresponding releases automatically appear on the games.teletype.hu portal.