跳到主要内容

EN-C023-044-docker-vps-ephemeral-preview-factory

English


[EN-C023-044] Docker/VPS: Ephemeral Preview Factory for PR Environments

Overview

Provision a short-lived VPS/Docker environment per pull request, publish a review URL, and destroy it automatically after merge/close or TTL expiration.

Use Case

  • Fast stakeholder review with production-like preview URLs.
  • Safer regression/load checks outside shared staging.
  • Cost control through strict TTL and automatic teardown.

OpenClaw Implementation Steps

  1. Enable config
    • Enable github webhook handling, cron, and exec for deployment commands.
    • Add policy guards for teardown and rollback.
  2. Acquire APIs
    • Create GitHub App or PAT (repo, workflow scopes).
    • Create VPS provider API token (example.com cloud provider).
  3. Operational setup
    • Trigger sessions_spawn on PR open/update to create environment.
    • Run health checks; rollback on failure, post URL on success.
    • Trigger cleanup by PR close/merge and TTL-based cron sweeps.

Trend Signals (GitHub/Reddit + V2EX/GitHub CN)

  • English communities: reusable ephemeral environment templates are becoming standard.
  • Chinese communities: low-cost VPS-first PR preview pipelines are increasingly common.

Registry ID: EN-044 | Status: Draft-Verified | Language: English