| name | deploy |
| source | ../../../../skills/deploy-assistant/SKILL.md |
| source_version | 1.0.0 |
| translation_version | 1.0.0 |
| last_synced | "2026-05-28T00:00:00.000Z" |
| scope | universal |
| description | [UDS] 無 CI/CD 平台環境下的可靠部署指引(不依賴 GitHub Actions / GitLab CI)。
Use when: deploying to VPS, air-gapped servers, or environments without CI/CD infrastructure.
Keywords: deployment, no-cicd, shell script, blue-green, smoke test, rollback, 無CI/CD, 部署.
|
| allowed-tools | Read, Bash(cat VERSION:*), Bash(git describe:*), Bash(which nginx:*), Bash(which rsync:*) |
| argument-hint | [專案類型: node/python/docker/go] |
無 CI/CD 部署助手
語言: English | 繁體中文
引導無 CI/CD 平台環境下的可靠部署,採用三層架構:防錯、驗證、快速回復。
三層部署架構
Layer 1:防止錯誤部署 Layer 2:驗證正確性 Layer 3:快速回復
set -euo pipefail Smoke Test + /health Blue-Green 切換
版本 tag 強制 版本號比對 rollback.sh < 30s
deploy.lock 並發守衛 驗證失敗自動回滾
引導式問答
| 問題 | 選項 | 影響 |
|---|
| 專案類型 | node / python / go / docker | 建置指令 |
| 部署目標 | SSH+rsync / Docker Compose | 傳輸方式 |
| Blue-Green 支援 | yes / no | rollback.sh 是否生成 |
| 健康檢查 URL | URL 輸入 | verify.sh 目標 |
| 版本來源 | VERSION 檔 / package.json / git tag | 版本比對邏輯 |
生成的腳本組
deploy.sh — 主要部署腳本
#!/usr/bin/env bash
set -euo pipefail
LOCK_FILE="/tmp/deploy.lock"
trap "rm -f $LOCK_FILE" EXIT
if [ -f "$LOCK_FILE" ]; then
echo "❌ 已有部署進行中(PID: $(cat $LOCK_FILE))"
exit 1
fi
echo $$ > "$LOCK_FILE"
CURRENT_TAG=$(git describe --exact-match --tags HEAD 2>/dev/null || echo "")
if [ -z "$CURRENT_TAG" ]; then
echo "❌ HEAD 沒有版本 tag。請執行:git tag vX.Y.Z && git push --tags"
1
rsync -avz --delete ./dist/ {USER}@{SERVER}:/app/
./verify.sh || { ; ./rollback.sh; 1; }
>> /var/log/deployments.jsonl