示例工程 50-ship-and-review
50-ship-and-review/demo-02-smoke/index.html
点击「运行示例」后,左侧显示源码、右侧显示运行结果;console 输出会实时回传。
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Smoke 与回滚演示</title>
<style>
body { margin: 0; padding: 32px; background: #f8fafc; color: #0f172a; font-family: system-ui, sans-serif; line-height: 1.7; }
.page { max-width: 760px; margin: 0 auto; }
h1 { margin: 0 0 12px; font-size: 28px; }
h2 { margin: 22px 0 8px; font-size: 18px; }
p { margin: 0 0 10px; color: #334155; }
table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
caption { padding: 6px 8px; text-align: left; color: #475569; font-size: 13px; }
th, td { padding: 8px 10px; border-bottom: 1px solid #e2e8f0; text-align: left; }
thead th { background: #f1f5f9; }
.tag { padding: 0 6px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.pass { background: #dcfce7; color: #166534; }
.fail { background: #fee2e2; color: #991b1b; }
.callout { padding: 10px 12px; border-left: 4px solid #d97706; border-radius: 6px; background: #fffbeb; color: #78350f; font-size: 14px; }
ol { margin: 8px 0 0; padding-left: 22px; color: #334155; }
code { padding: 1px 5px; border-radius: 4px; background: #f1f5f9; font-family: ui-monospace, monospace; }
pre { margin: 8px 0 0; padding: 10px 12px; overflow-x: auto; border-radius: 8px; background: #0f172a; color: #e2e8f0; font-size: 12px; }
pre code { padding: 0; background: none; color: inherit; }
</style>
</head>
<body>
<div class="page">
<h1>Smoke 与回滚</h1>
<h2>检查表</h2>
<table>
<caption>部署后 5 分钟内执行</caption>
<thead>
<tr><th scope="col">检查</th><th scope="col">命令</th><th scope="col">期望</th><th scope="col">结果</th></tr>
</thead>
<tbody>
<tr><th scope="row">首页</th><td><code>curl -I /</code></td><td>200</td><td><span class="tag pass">PASS</span></td></tr>
<tr><th scope="row">指南</th><td><code>curl -I /guides/water-leak/</code></td><td>200</td><td><span class="tag pass">PASS</span></td></tr>
<tr><th scope="row">旧链接</th><td><code>curl -I /old</code></td><td>301</td><td><span class="tag pass">PASS</span></td></tr>
<tr><th scope="row">404</th><td><code>curl -I /nope</code></td><td>404</td><td><span class="tag pass">PASS</span></td></tr>
<tr><th scope="row">表单</th><td>手动提交</td><td>成功 + 确认</td><td><span class="tag fail">FAIL</span></td></tr>
</tbody>
</table>
<h2>失败分支</h2>
<p class="callout">表单提交失败属于阻断项:立即回滚,不在线上继续调试。</p>
<ol>
<li>停止推广与通知。</li>
<li>回到上一个已知良好版本。</li>
<li>重跑 smoke。</li>
<li>记录影响范围与时间线。</li>
</ol>
<pre><code>git checkout v0.9.3
pnpm build
pnpm deploy</code></pre>
</div>
</body>
</html>