# 04 — Website & Deployment Completion ## Website 生命周期 ```text Website → Repository → Environment → Server → Build → Deploy → Health Check → Domain → SSL → Monitoring ``` ## Repository access 禁止要求用户把 private repository token 放进 URL。 建立: ```text GitProviderConnection ├── provider ├── credentialId ├── externalAccountId └── metadata ``` Repository 使用 provider + externalId/clone metadata。 ## Deployment Deployment 必须成为 Job 的一种领域操作,并保存: - commit/ref - source repository - target server - environment - build strategy - deployment strategy - started/finished - logs - result - health check ## 部署策略 V1 支持: 1. Docker Compose / Dockerfile 项目 2. 静态网站 3. 可扩展 deployment adapter 不要把部署逻辑硬编码到 Website Controller。 ## Environment 支持: - development - staging - production 环境变量值使用 Credential Vault 或加密存储,UI 默认 mask。 ## Health verification 部署成功不能只看 SSH exit code,必须执行 health check;失败则 Deployment 状态为 failed/verification_failed,并展示证据。