ci(phoenix): workflow_dispatch reinstall for phoenix-deploy-api on CT 5700 #16
Reference in New Issue
Block a user
Delete Branch "devin/1777403009-phoenix-bootstrap"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Closes the third item of the post-merge optional follow-ups: ship the missing bootstrap path for
phoenix-deploy-apion CT 5700.The current state on
master:phoenix-deploy-api/server.jsis the real implementation (executeDeployviaexecFile,prepareDeployWorkspace, healthcheck, Gitea status, outbound webhook). Verified by grep — the stringDeploy request queued (stub)does NOT exist onmaster.{"status":"accepted",...,"message":"Deploy request queued (stub)..."}for every target. Sodeploy-to-phoenix.yml's deploy / deploy-atomic-swap-dapp jobs return 202 but never executescripts/deployment/deploy-atomic-swap-dapp-5801.sh.scripts/deployment/deploy-phoenix-deploy-api-to-dev-vm.shalready implements the full ship path (tar → scp to PVE → pct push to CT → runinstall-systemd.sh→ curl /health) for a LAN operator. The gap was: no Gitea-Actions surface for it, so a normal "push to master" cannot heal a stale CT.This PR adds
.gitea/workflows/bootstrap-phoenix-deploy-api.yml, aworkflow_dispatch-only job that mirrors the LAN script as a CI runner step:phoenix-deploy-api/server.jsstill contains the stub string (defence-in-depth against a regression).PHOENIX_PVE_SSH_KEY(use a dedicated deploy key, not your personal key); pin host withPHOENIX_PVE_KNOWN_HOSTSif set, elseaccept-new.tar czfphoenix-deploy-api/+config/public-sector-program-manifest.json(manifest is optional; warned not failed).GET /healthwith retry.POST /api/deploywithtarget: "__bootstrap_probe__"and the deploy bearer token. Fails the workflow if the response body still containsDeploy request queued (stub)or any auth-rejection signal. This is the unambiguous post-bootstrap health signal in CI logs.workflow_dispatch-only by design — reinstalling the deploy service is sensitive enough that we want it gated behind a deliberate manual click, not fired on every master push.Files
.gitea/workflows/bootstrap-phoenix-deploy-api.yml— new workflow.docs/04-configuration/DEVIN_GITEA_PROXMOX_CICD.md— new §3a "Bootstrap workflow secrets (one-time per CT)" listing the new secrets and explaining the non-stub probe.Validation
End-to-end CI verification of the new workflow itself was not run from this VM — the workflow needs the new secrets (
PHOENIX_PVE_HOST,PHOENIX_PVE_SSH_KEY,PHOENIX_PVE_KNOWN_HOSTS,PHOENIX_DEV_VM_VMID,PHOENIX_DEPLOY_DEV_VM_IP) populated in the Gitea repo before it can ssh into the PVE node. Setting those is intentionally a maintainer step; the docs section guides through it.Review & Testing Checklist for Human
PHOENIX_PVE_HOST(PVE node IP that hosts CT 5700, e.g.192.168.11.12)PHOENIX_PVE_USER(defaultroot, set if different)PHOENIX_PVE_SSH_KEY(PEM-format private key, dedicated deploy key recommended)PHOENIX_PVE_KNOWN_HOSTS(one-line known_hosts entry; optional but recommended)PHOENIX_DEV_VM_VMID(default5700)PHOENIX_DEPLOY_DEV_VM_IP(default192.168.11.59)deploy-to-phoenix.yml(push or workflow_dispatch). Check the deploy / deploy-atomic-swap-dapp jobs' Phoenix response body — should NOT containDeploy request queued (stub)anymore.curl -sS https://atomic-swap.defi-oracle.io/ | grep -oE 'assets/index-[^"]+\.js' | head -1).Notes
PHOENIX_PVE_SSH_KEYis incorrect or not authorised on the PVE node, the scp step will fail with a clean SSH error message.Closes the gap where phoenix-deploy-api/server.js on master is the real implementation, but the running service on CT 5700 is the older stub that returns 'Deploy request queued (stub)' for every target. The new workflow .gitea/workflows/bootstrap-phoenix-deploy-api.yml is manual-only (workflow_dispatch). When triggered it: 1. Validates the repo layout (phoenix-deploy-api/server.js MUST NOT contain the stub string). 2. Tars phoenix-deploy-api/ + config/public-sector-program-manifest.json into a deploy bundle. 3. scp's the bundle to the PVE node that hosts CT 5700 using a dedicated deploy SSH key (PHOENIX_PVE_SSH_KEY repo secret). 4. pct push / pct exec the bundle into the CT and runs the existing phoenix-deploy-api/scripts/install-systemd.sh which already drops /opt/phoenix-deploy-api/, writes the systemd unit, and restarts the service. 5. Health-checks GET http://<dev-vm>:4001/health (with retry). 6. Posts a non-stub probe: POST /api/deploy with target __bootstrap_probe__ + the deploy bearer token. Fails the workflow if the response body still contains 'Deploy request queued (stub)' or any auth-rejection signal. That gives an unambiguous post-bootstrap health signal in CI logs without depending on a successful real deploy. Required new secrets (documented in docs/04-configuration/DEVIN_GITEA_PROXMOX_CICD.md section 3a): PHOENIX_PVE_HOST, PHOENIX_PVE_USER (default root), PHOENIX_PVE_SSH_KEY, PHOENIX_PVE_KNOWN_HOSTS (optional), PHOENIX_DEV_VM_VMID (default 5700), PHOENIX_DEPLOY_DEV_VM_IP (default 192.168.11.59). Triggered manually only — bootstrap is sensitive enough that we do NOT fire on every master push. Once the running service on CT 5700 is post-stub, the existing deploy job in deploy-to-phoenix.yml will actually execute scripts/deployment/deploy-atomic-swap-dapp-5801.sh on each push instead of returning a 202 stub. Co-Authored-By: Nakamoto, S <defi@defi-oracle.io>Claude encountered an error —— View job
I'll analyze this and get back to you.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.