Remove the droparea: artifacts arrive over /build/upload
This commit is contained in:
@@ -12,9 +12,9 @@ Repository: `https://git.teletypegames.org/tools/warp_engine`
|
||||
- **Catalog domain**: `Software`, `Release`, `ReleaseAsset`, `ExternalLink`,
|
||||
`PlatformLink`, `Image`, `SoftwareImage`, `Download` models with soft-delete
|
||||
semantics and download statistics.
|
||||
- **CI-callable updater**: your build pipeline drops artifacts into a
|
||||
directory and calls one endpoint — WarpEngine extracts archives, parses
|
||||
metadata and upserts the catalog records. Supported platforms out of the
|
||||
- **CI-callable updater**: your build pipeline uploads artifacts over HTTP
|
||||
and calls one endpoint — WarpEngine extracts archives, parses metadata
|
||||
and upserts the catalog records. Supported platforms out of the
|
||||
box: TIC-80, Ebitengine, LÖVE, C64, Godot, Bevy, Phaser. Authenticated by
|
||||
a shared secret or by per-owner database tokens with expiry and scopes
|
||||
(`ApplicationToken`, managed in the admin).
|
||||
@@ -36,19 +36,18 @@ Repository: `https://git.teletypegames.org/tools/warp_engine`
|
||||
## Example stack (docker compose)
|
||||
|
||||
`examples/compose` boots everything the engine's workflow assumes, end to
|
||||
end: the catalog app itself, the SSH drop area the updater contract feeds
|
||||
from and — behind a compose profile — a Gitea forge with Woodpecker CI, so
|
||||
you can watch a pipeline publish a release into the catalog.
|
||||
end: the catalog app itself and — behind a compose profile — a Gitea forge
|
||||
with Woodpecker CI, so you can watch a pipeline publish a release into the
|
||||
catalog.
|
||||
|
||||
| Service | Role | Where |
|
||||
| --- | --- | --- |
|
||||
| `app` | Minimal Rails host with the engine mounted as a path gem (headless: API + updater) | `http://localhost:8080` |
|
||||
| `mysql` | Catalog database | internal |
|
||||
| `droparea` | SSH server where pipelines drop build artifacts; shares the `softwares` volume with `app` | `ssh drop@localhost -p 2222` |
|
||||
| `gitea` | Git forge (profile `ci`) | `http://gitea:3000` |
|
||||
| `woodpecker` + agent | CI wired to gitea (profile `ci`) | `http://woodpecker:8000` |
|
||||
|
||||
### Quickstart — catalog + drop area
|
||||
### Quickstart — catalog only
|
||||
|
||||
```sh
|
||||
cd examples/compose
|
||||
@@ -89,10 +88,6 @@ curl -X POST -H "X-Update-Secret: example-update-secret" \
|
||||
"http://localhost:8080/build/publish?platform=love&name=demo&version=0.1.0"
|
||||
```
|
||||
|
||||
(Dropping the files in over the SSH drop area — `scp -P 2222 demo-0.1.0.*
|
||||
drop@localhost:drop/`, password `DROP_PASSWORD` from `.env` — works just as
|
||||
well; the updater only cares that the files end up in `file_container_path`.)
|
||||
|
||||
`GET /api/software` now lists *Demo Game* with `html` and `win_x64` assets,
|
||||
`http://localhost:8080/file/demo-0.1.0/index.html` serves the extracted web
|
||||
build, and `GET /api/download?path=demo-0.1.0-win-x64.zip` serves the
|
||||
@@ -221,8 +216,7 @@ Publishing a release from CI is two steps:
|
||||
1. **Upload** build artifacts into `file_container_path`, named by convention:
|
||||
`<name>-<version>.metadata.json`, `<name>-<version>.html.zip`,
|
||||
`<name>-<version>-win-x64.zip`, `<name>-<version>.tic`, ... (each platform
|
||||
declares which asset kinds it expects — see `GET /api/builds`). Either
|
||||
drop the files in over the shared volume (SSH drop area), or push them
|
||||
declares which asset kinds it expects — see `GET /api/builds`). Push them
|
||||
over HTTP — one request per file, `upload` scope, optional `sha256`
|
||||
integrity check:
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ module WarpEngine
|
||||
# <name>-<version>-<target>.zip — az updater is ezeket keresi.
|
||||
NAME_FORMAT = /\A[A-Za-z0-9._-]+\z/
|
||||
|
||||
api :POST, "/build/upload", "Upload a build artifact into the drop area"
|
||||
api :POST, "/build/upload", "Upload a build artifact into the artifact directory"
|
||||
header "X-Update-Secret", "Shared secret or application token (upload scope)", required: true
|
||||
param :name, String, required: true, desc: "Software name (filename must be prefixed with <name>-<version>)"
|
||||
param :version, String, required: true, desc: "Version string"
|
||||
|
||||
@@ -6,12 +6,8 @@ MYSQL_ROOT_PASSWORD=warpengine
|
||||
# Shared secret for the /build/* endpoints (X-Update-Secret header).
|
||||
UPDATE_SECRET=example-update-secret
|
||||
|
||||
# Password of the "drop" user on the artifact drop area (SSH, port 2222).
|
||||
DROP_PASSWORD=drop
|
||||
|
||||
# Published ports.
|
||||
APP_PORT=8080
|
||||
DROPAREA_SSH_PORT=2222
|
||||
GITEA_SSH_PORT=2223
|
||||
|
||||
# --- profile "ci" only -------------------------------------------------------
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
# mysql the catalog database
|
||||
# app a minimal Rails host with the engine mounted from this
|
||||
# repo checkout (headless: API + updater, no ActiveAdmin)
|
||||
# droparea SSH server where build pipelines drop artifacts; shares
|
||||
# the "softwares" volume with the app
|
||||
# gitea (profile "ci") the git forge
|
||||
# woodpecker (profile "ci") CI server + agent, wired to gitea
|
||||
#
|
||||
# Quickstart (catalog + drop area only):
|
||||
# Quickstart (catalog only):
|
||||
# cp .env.example .env
|
||||
# docker compose up --build
|
||||
#
|
||||
@@ -51,24 +49,6 @@ services:
|
||||
- softwares:/softwares
|
||||
- images:/images
|
||||
|
||||
# SSH landing zone for build artifacts. Pipelines (or you, with scp) upload
|
||||
# into ~/drop here; the app sees the same files under /softwares.
|
||||
droparea:
|
||||
image: linuxserver/openssh-server
|
||||
environment:
|
||||
PUID: 1
|
||||
PGID: 1
|
||||
SUDO_ACCESS: "false"
|
||||
PASSWORD_ACCESS: "true"
|
||||
USER_NAME: drop
|
||||
USER_PASSWORD: ${DROP_PASSWORD:-drop}
|
||||
ports:
|
||||
- "${DROPAREA_SSH_PORT:-2222}:2222"
|
||||
volumes:
|
||||
# A subdir of the drop user's home (/config), so sshd's own state files
|
||||
# never end up in the catalog directory.
|
||||
- softwares:/config/drop
|
||||
|
||||
# --- profile "ci": the forge + CI producing releases for the catalog ------
|
||||
#
|
||||
# gitea and woodpecker refer to each other by their service names, so your
|
||||
@@ -113,7 +93,7 @@ services:
|
||||
WOODPECKER_SERVER: "woodpecker:9000"
|
||||
WOODPECKER_AGENT_SECRET: ${WOODPECKER_AGENT_SECRET:-example-agent-secret}
|
||||
# Attach pipeline containers to the stack network so steps can reach
|
||||
# gitea, droparea and the app by service name.
|
||||
# gitea and the app by service name.
|
||||
WOODPECKER_BACKEND_DOCKER_NETWORK: warp-example
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
|
||||
Reference in New Issue
Block a user