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`,
|
- **Catalog domain**: `Software`, `Release`, `ReleaseAsset`, `ExternalLink`,
|
||||||
`PlatformLink`, `Image`, `SoftwareImage`, `Download` models with soft-delete
|
`PlatformLink`, `Image`, `SoftwareImage`, `Download` models with soft-delete
|
||||||
semantics and download statistics.
|
semantics and download statistics.
|
||||||
- **CI-callable updater**: your build pipeline drops artifacts into a
|
- **CI-callable updater**: your build pipeline uploads artifacts over HTTP
|
||||||
directory and calls one endpoint — WarpEngine extracts archives, parses
|
and calls one endpoint — WarpEngine extracts archives, parses metadata
|
||||||
metadata and upserts the catalog records. Supported platforms out of the
|
and upserts the catalog records. Supported platforms out of the
|
||||||
box: TIC-80, Ebitengine, LÖVE, C64, Godot, Bevy, Phaser. Authenticated by
|
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
|
a shared secret or by per-owner database tokens with expiry and scopes
|
||||||
(`ApplicationToken`, managed in the admin).
|
(`ApplicationToken`, managed in the admin).
|
||||||
@@ -36,19 +36,18 @@ Repository: `https://git.teletypegames.org/tools/warp_engine`
|
|||||||
## Example stack (docker compose)
|
## Example stack (docker compose)
|
||||||
|
|
||||||
`examples/compose` boots everything the engine's workflow assumes, end to
|
`examples/compose` boots everything the engine's workflow assumes, end to
|
||||||
end: the catalog app itself, the SSH drop area the updater contract feeds
|
end: the catalog app itself and — behind a compose profile — a Gitea forge
|
||||||
from and — behind a compose profile — a Gitea forge with Woodpecker CI, so
|
with Woodpecker CI, so you can watch a pipeline publish a release into the
|
||||||
you can watch a pipeline publish a release into the catalog.
|
catalog.
|
||||||
|
|
||||||
| Service | Role | Where |
|
| Service | Role | Where |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| `app` | Minimal Rails host with the engine mounted as a path gem (headless: API + updater) | `http://localhost:8080` |
|
| `app` | Minimal Rails host with the engine mounted as a path gem (headless: API + updater) | `http://localhost:8080` |
|
||||||
| `mysql` | Catalog database | internal |
|
| `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` |
|
| `gitea` | Git forge (profile `ci`) | `http://gitea:3000` |
|
||||||
| `woodpecker` + agent | CI wired to gitea (profile `ci`) | `http://woodpecker:8000` |
|
| `woodpecker` + agent | CI wired to gitea (profile `ci`) | `http://woodpecker:8000` |
|
||||||
|
|
||||||
### Quickstart — catalog + drop area
|
### Quickstart — catalog only
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cd examples/compose
|
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"
|
"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,
|
`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
|
`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
|
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:
|
1. **Upload** build artifacts into `file_container_path`, named by convention:
|
||||||
`<name>-<version>.metadata.json`, `<name>-<version>.html.zip`,
|
`<name>-<version>.metadata.json`, `<name>-<version>.html.zip`,
|
||||||
`<name>-<version>-win-x64.zip`, `<name>-<version>.tic`, ... (each platform
|
`<name>-<version>-win-x64.zip`, `<name>-<version>.tic`, ... (each platform
|
||||||
declares which asset kinds it expects — see `GET /api/builds`). Either
|
declares which asset kinds it expects — see `GET /api/builds`). Push them
|
||||||
drop the files in over the shared volume (SSH drop area), or push them
|
|
||||||
over HTTP — one request per file, `upload` scope, optional `sha256`
|
over HTTP — one request per file, `upload` scope, optional `sha256`
|
||||||
integrity check:
|
integrity check:
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ module WarpEngine
|
|||||||
# <name>-<version>-<target>.zip — az updater is ezeket keresi.
|
# <name>-<version>-<target>.zip — az updater is ezeket keresi.
|
||||||
NAME_FORMAT = /\A[A-Za-z0-9._-]+\z/
|
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
|
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 :name, String, required: true, desc: "Software name (filename must be prefixed with <name>-<version>)"
|
||||||
param :version, String, required: true, desc: "Version string"
|
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).
|
# Shared secret for the /build/* endpoints (X-Update-Secret header).
|
||||||
UPDATE_SECRET=example-update-secret
|
UPDATE_SECRET=example-update-secret
|
||||||
|
|
||||||
# Password of the "drop" user on the artifact drop area (SSH, port 2222).
|
|
||||||
DROP_PASSWORD=drop
|
|
||||||
|
|
||||||
# Published ports.
|
# Published ports.
|
||||||
APP_PORT=8080
|
APP_PORT=8080
|
||||||
DROPAREA_SSH_PORT=2222
|
|
||||||
GITEA_SSH_PORT=2223
|
GITEA_SSH_PORT=2223
|
||||||
|
|
||||||
# --- profile "ci" only -------------------------------------------------------
|
# --- profile "ci" only -------------------------------------------------------
|
||||||
|
|||||||
@@ -3,12 +3,10 @@
|
|||||||
# mysql the catalog database
|
# mysql the catalog database
|
||||||
# app a minimal Rails host with the engine mounted from this
|
# app a minimal Rails host with the engine mounted from this
|
||||||
# repo checkout (headless: API + updater, no ActiveAdmin)
|
# 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
|
# gitea (profile "ci") the git forge
|
||||||
# woodpecker (profile "ci") CI server + agent, wired to gitea
|
# woodpecker (profile "ci") CI server + agent, wired to gitea
|
||||||
#
|
#
|
||||||
# Quickstart (catalog + drop area only):
|
# Quickstart (catalog only):
|
||||||
# cp .env.example .env
|
# cp .env.example .env
|
||||||
# docker compose up --build
|
# docker compose up --build
|
||||||
#
|
#
|
||||||
@@ -51,24 +49,6 @@ services:
|
|||||||
- softwares:/softwares
|
- softwares:/softwares
|
||||||
- images:/images
|
- 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 ------
|
# --- profile "ci": the forge + CI producing releases for the catalog ------
|
||||||
#
|
#
|
||||||
# gitea and woodpecker refer to each other by their service names, so your
|
# gitea and woodpecker refer to each other by their service names, so your
|
||||||
@@ -113,7 +93,7 @@ services:
|
|||||||
WOODPECKER_SERVER: "woodpecker:9000"
|
WOODPECKER_SERVER: "woodpecker:9000"
|
||||||
WOODPECKER_AGENT_SECRET: ${WOODPECKER_AGENT_SECRET:-example-agent-secret}
|
WOODPECKER_AGENT_SECRET: ${WOODPECKER_AGENT_SECRET:-example-agent-secret}
|
||||||
# Attach pipeline containers to the stack network so steps can reach
|
# 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
|
WOODPECKER_BACKEND_DOCKER_NETWORK: warp-example
|
||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
|||||||
Reference in New Issue
Block a user