From 7173d02dcd7ec355c303a1a2955ad36609483c3e Mon Sep 17 00:00:00 2001 From: Zsolt Tasnadi Date: Wed, 5 Aug 2026 20:32:36 +0200 Subject: [PATCH] Switch the CI templates to the /build HTTP endpoints --- README.md | 9 ++++----- example-makefile.make | 10 ++++++---- example-woodpecker.yaml | 11 ++++------- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index dd53db9..7f9b0cd 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,7 @@ projects, in the same spirit as `ci-update`). - `example-woodpecker.yaml` — Woodpecker pipeline: version → build (syntax check + web bundle in the - `git.teletypegames.org/internal/phaser-builder` image) → upload (scp to - the droparea) → update (calls the teletypegames `/update` endpoint + `git.teletypegames.org/internal/phaser-builder` image) → upload (HTTP POST to `/build/upload`) → update (calls the teletypegames `/build/publish` endpoint with `platform=phaser`). - `builder.Dockerfile` — the CI builder image: `node:22-alpine` with make/zip/curl baked in. @@ -35,15 +34,15 @@ single `game.js`. Node is only used for a `node --check` syntax pass. concatenated in filename order — prefix with numbers if load order matters). 2. Copy `example-woodpecker.yaml` to `.woodpecker.yaml` and add the - `droparea_ssh_password` / `update_secret_key` secrets in Woodpecker. + `update_secret_key` secret in Woodpecker. 3. Copy `example-tasks.json` to `.vscode/tasks.json`. `make serve` builds the web bundle and serves it on `http://localhost:8000` (Python 3's built-in HTTP server). -The pipeline uploads `$(PROJECT)-$(VERSION).html.zip` to the droparea, +The pipeline uploads `$(PROJECT)-$(VERSION).html.zip` via `/build/upload`, then triggers -`/update?platform=phaser&name=$(PROJECT)&version=$(VERSION)`. +`/build/publish?platform=phaser&name=$(PROJECT)&version=$(VERSION)`. ## Builder image diff --git a/example-makefile.make b/example-makefile.make index 722c44b..bbf47bb 100644 --- a/example-makefile.make +++ b/example-makefile.make @@ -71,12 +71,14 @@ ci-upload: META_SRC="metadata.json"; \ META_DST="$(PROJECT)-$$VERSION.metadata.json"; \ cp $$META_SRC $$META_DST; \ - sshpass -p "$(DROPAREA_SSH_PASSWORD)" scp -o StrictHostKeyChecking=no -P $(DROPAREA_PORT) \ - $$FILE $$META_DST \ - $(DROPAREA_USER)@$(DROPAREA_HOST):$(DROPAREA_TARGET_PATH)/ + for f in $$FILE $$META_DST; do \ + curl -fsS -H "X-Update-Secret: $(UPDATE_SECRET)" \ + -F "file=@$$f" \ + "$(UPDATE_SERVER)/build/upload?name=$(PROJECT)&version=$$VERSION" || exit 1; \ + done ci-update: @VERSION=$$(cat $(VERSION_FILE)); \ - curl "$(UPDATE_SERVER)/update?secret=$(UPDATE_SECRET)&name=$(PROJECT)&platform=phaser&version=$$VERSION" + curl -fsS -X POST -H "X-Update-Secret: $(UPDATE_SECRET)" "$(UPDATE_SERVER)/build/publish?name=$(PROJECT)&platform=phaser&version=$$VERSION" .PHONY: all build web serve export watch clean ci-version ci-export ci-upload ci-update diff --git a/example-woodpecker.yaml b/example-woodpecker.yaml index a26b34a..fed9e51 100644 --- a/example-woodpecker.yaml +++ b/example-woodpecker.yaml @@ -13,14 +13,11 @@ steps: - name: upload image: alpine environment: - DROPAREA_HOST: vps.teletype.hu - DROPAREA_PORT: 2223 - DROPAREA_TARGET_PATH: /home/drop - DROPAREA_USER: drop - DROPAREA_SSH_PASSWORD: - from_secret: droparea_ssh_password + UPDATE_SERVER: https://teletypegames.org + UPDATE_SECRET: + from_secret: update_secret_key commands: - - apk add --no-cache make openssh-client sshpass + - apk add --no-cache make curl - make ci-upload - name: update