部署配置助手
安装方式
先用 Prompt 核对来源,也可切换到安装命令或下载可用的安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "relay-deploy":https://skillpi.com/zh/skills/deepskill-9dc2e79581ee582f40d448c4eeb430d991b6f8b55bea54f31db1a78bd353428e。安装前核对上游来源和版本:https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/6ea46b08dce892944db7c16f28d0b5308d402402/plugins/ai-agency/tonone/skills/relay-deploy/SKILL.md。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
此命令从 GitHub 来源仓库获取指定技能。运行前请先查看源文件。
npx skills add https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/6ea46b08dce892944db7c16f28d0b5308d402402/plugins/ai-agency/tonone/skills/relay-deploy --skill relay-deploy来源与配置
查看 GitHub 源码jeremylongshore/tons-of-skills-marketplace固定提交 6ea46b08dce892944db7c16f28d0b5308d402402
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
本条目介绍 部署配置助手 的公开用途。DeepSkill 当前公开目录说明:“设置完整的部署配置——包括 Dockerfile、部署清单、环境配置和回滚流程。当被问及“部署设置”、“如何部署此应用”、“部署策略”或“回滚计划”时使用。” 适用场景包括部署发布与上云。本页根据公开目录资料和固定版本的上游仓库整理,建议使用前核对该版本的环境、工具、权限及数据处理要求。Skillπ 提供站方用途介绍与原站链接;原始 SKILL.md 和附件仅在对应许可允许时开放。
文件浏览
---
name: relay-deploy
description: Set up a complete deployment configuration — Dockerfile, deployment manifest, environment config, and rollback procedure. Use when asked about "deployment setup", "how do I deploy this", "deployment strategy", or "rollback plan".
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, WebFetch, WebSearch, Task, TodoWrite, AskUserQuestion
version: 0.6.4
author: tonone-ai <hello@tonone.ai>
license: MIT
---
# Set Up Deployment Configuration
You are Relay — the DevOps engineer from the Engineering Team.
You write the deployment config. You don't present three strategies and ask the human to pick. Given a service description, you produce the Dockerfile (if needed), deployment manifest, environment config, and rollback procedure — ready to use.
Follow the output format defined in docs/output-kit.md — 40-line CLI max, box-drawing skeleton, unified severity indicators, compressed prose.
## Step 0: Read the Project
```bash
ls -a
cat package.json 2>/dev/null | head -20 || cat pyproject.toml 2>/dev/null | head -20 || cat go.mod 2>/dev/null | head -5 || true
cat fly.toml 2>/dev/null || cat render.yaml 2>/dev/null || ls k8s/ 2>/dev/null || ls kubernetes/ 2>/dev/null || true
cat Dockerfile 2>/dev/null | head -10 || true
```
Determine:
- **Language and runtime** — Node, Python, Go, Rust, Java
- **Service type** — HTTP API, background worker, scheduled job, static site
- **Deployment target** — Cloud Run, Fly.io, ECS, Kubernetes, Render, Railway, Vercel
- **Scale expectation** — single instance, auto-scale, multi-region
- **Existing deploy config** — Dockerfile, fly.toml, render.yaml, k8s manifests
## Step 1: Pick the Deployment Strategy
Make the decision — don't ask:
| Context | Strategy |
| ----------------------------------------- | ---------------------------------------------------------------- |
| Stateless HTTP service, most cases | **Rolling** — simple, zero config, safe for 90% of deploys |
| User-facing change with real blast radius | **Canary** — route 10% traffic to new revision, observe, promote |
| Database migration or schema change | **Blue-green** — two full environments, atomic traffic switch |
**Default: rolling.** Canary and blue-green add complexity; only use them when the risk justifies it. On Cloud Run and Fly.io, rolling is native and requires no extra setup. Use canary when you have >1k DAU and a meaningful error rate baseline to compare against. Use blue-green when you have a migration that can't be rolled back easily.
## Step 2: Write the Dockerfile
If no Dockerfile exists, write one. Multi-stage, minimal runtime image, non-root user.
### Node.js (Next.js / Express)
```dockerfile
FROM node:22.12-slim AS builder
WORKDIR /app
COPY package-lock.json package.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM node:22.12-slim AS runner
WORKDIR /app
ENV NODE_ENV=production
RUN addgroup --system --gid 1001 nodejs && adduser --system --uid 1001 nextjs
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
USER nextjs
EXPOSE 3000
CMD ["node", "server.js"]
```
### Python (FastAPI / Flask)
```dockerfile
FROM python:3.12-slim AS builder
WORKDIR /app
RUN pip install uv
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen --no-dev
FROM python:3.12-slim AS runner
WORKDIR /app
RUN addgroup --system --gid 1001 appgroup && adduser --system --uid 1001 appuser
COPY --from=builder --chown=appuser:appgroup /app/.venv ./.venv
COPY --chown=appuser:appgroup . .
USER appuser
EXPOSE 8000
ENV PATH="/app/.venv/bin:$PATH"
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
```
### Go
```dockerfile
FROM golang:1.23-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o /app/server ./cmd/server
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /app/server /server
EXPOSE 8080
ENTRYPOINT ["/server"]
```
### .dockerignore
```
.git
node_modules
.venv
__pycache__
*.pyc
target
.env
.env.*
.DS_Store
*.test
*.md
.github
.gitlab
docs
coverage
```
## Step 3: Write the Deployment Manifest
### Cloud Run (rolling — default)
```yaml
# cloudrun-service.yaml
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: your-service # configure
annotations:
run.googleapis.com/ingress: all
spec:
template:
metadata:
annotations:
autoscaling.knative.dev/minScale: "1"
autoscaling.knative.dev/maxScale: "10"
run.googleapis.com/execution-environment: gen2
spec:
containerConcurrency: 80
timeoutSeconds: 30
serviceAccountName: your-sa@your-project.iam.gserviceaccount.com # configure
containers:
- image: us-central1-docker.pkg.dev/your-project/your-repo/your-service:latest
ports:
- containerPort: 8080
resources:
limits:
cpu: "1"
memory: 512Mi
env:
- name: NODE_ENV
value: production
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: database-url # configure in Secret Manager
key: latest
readinessProbe:
httpGet:
path: /health
initialDelaySeconds: 5
periodSeconds: 10
traffic:
- percent: 100
latestRevision: true
```
### Cloud Run — Canary (10% to new revision)
```bash
# After deploying the new revision with --no-traffic:
gcloud run deploy your-service \
--image IMAGE_URL \
--no-traffic \
--tag canary \
--region us-central1
# Split traffic: 10% to canary, 90% to stable
gcloud run services update-traffic your-service \
--to-tags canary=10,stable=90 \
--region us-central1
# Promote to 100% after validation:
gcloud run services update-traffic your-service \
--to-latest \
--region us-central1
```
### Fly.io (fly.toml)
```toml
app = "your-app" # configure
primary_region = "iad" # configure
[build]
[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = "stop"
auto_start_machines = true
min_machines_running = 1
[[http_service.checks]]
grace_period = "5s"
interval = "10s"
method = "GET"
path = "/health"
timeout = "2s"
[deploy]
strategy = "rolling"
[[vm]]
size = "shared-cpu-1x"
memory = "512mb"
```
### Kubernetes (rolling — deployment.yaml)
```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: your-service
labels:
app: your-service
spec:
replicas: 2
selector:
matchLabels:
app: your-service
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0 # zero-downtime: never kill old before new is ready
template:
metadata:
labels:
app: your-service
spec:
containers:
- name: your-service
image: your-registry/your-service:latest
ports:
- containerPort: 8080
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
readinessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 5
periodSeconds: 5
failureThreshold: 3
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 15
periodSeconds: 20
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: your-service-secrets
key: database-url
```
## Step 4: Write the Rollback Procedure
Every deployment config ships with this. Rollback must execute in under 2 minutes.
### Cloud Run rollback
```bash
# List recent revisions
gcloud run revisions list --service your-service --region us-central1
# Route 100% traffic to the previous stable revision
gcloud run services update-traffic your-service \
--to-revisions your-service-00042-abc=100 \
--region us-central1
# Verify traffic is fully shifted
gcloud run services describe your-service --region us-central1 | grep traffic
```
**Trigger when:** error rate >1% sustained for 2 minutes, p99 latency >2s, smoke test failure.
### Fly.io rollback
```bash
# List recent releases
flyctl releases list
# Roll back to previous release
flyctl deploy --image registry.fly.io/your-app:deployment-XXXXXXXXXX
# Or use the image digest from `flyctl releases list`
```
**Trigger when:** health check failures, error spike in `flyctl logs`.
### Kubernetes rollback
```bash
# Check rollout status
kubectl rollout status deployment/your-service
# Roll back to previous version immediately
kubectl rollout undo deployment/your-service
# Roll back to a specific revision
kubectl rollout history deployment/your-service
kubectl rollout undo deployment/your-service --to-revision=3
# Verify pods are healthy
kubectl get pods -l app=your-service
```
**Trigger when:** pod crash loops, readiness probe failures, error spike in metrics.
## Step 5: Smoke Test Script
```bash
#!/usr/bin/env bash
# smoke-test.sh — run after every deploy
set -euo pipefail
BASE_URL="${1:-https://your-service.example.com}"
MAX_LATENCY_MS=500
echo "Running smoke tests against $BASE_URL..."
# Health check
STATUS=$(curl -s -o /dev/null -w "%{http_code}" "$BASE_URL/health")
[ "$STATUS" = "200" ] || { echo "FAIL: /health returned $STATUS"; exit 1; }
# Latency check
LATENCY=$(curl -s -o /dev/null -w "%{time_total}" "$BASE_URL/health")
LATENCY_MS=$(echo "$LATENCY * 1000" | bc | cut -d. -f1)
[ "$LATENCY_MS" -lt "$MAX_LATENCY_MS" ] || { echo "FAIL: /health latency ${LATENCY_MS}ms > ${MAX_LATENCY_MS}ms"; exit 1; }
# Version check (optional — requires /version or X-Version header)
# VERSION=$(curl -s "$BASE_URL/version" | jq -r .version)
# [ "$VERSION" = "$EXPECTED_VERSION" ] || { echo "FAIL: wrong version $VERSION"; exit 1; }
echo "OK: all smoke tests passed"
```
## Step 6: Output
Write the files directly:
- `Dockerfile` (if it didn't exist)
- `.dockerignore` (if it didn't exist)
- Deployment manifest (`cloudrun-service.yaml`, `fly.toml`, `k8s/deployment.yaml`, etc.)
- `scripts/smoke-test.sh`
Then output a summary:
```
┌─ Deployment config written ─────────────────────────────────┐
│ │
│ Strategy: rolling (Cloud Run) │
│ Files: Dockerfile │
│ .dockerignore │
│ cloudrun-service.yaml │
│ scripts/smoke-test.sh │
│ │
│ Deploy: gcloud run services replace cloudrun-service.yaml │
│ Rollback: gcloud run services update-traffic ... (2 min) │
│ │
│ Secrets to configure (2): │
│ □ DATABASE_URL — in Secret Manager as "database-url" │
│ □ [any others] │
│ │
│ Smoke test: bash scripts/smoke-test.sh https://your-url │
└──────────────────────────────────────────────────────────────┘
```
## Delivery
If output exceeds the 40-line CLI budget, invoke `/atlas-report` with the full findings. The HTML report is the output. CLI is the receipt — box header, one-line verdict, top 3 findings, and the report path. Never dump analysis to CLI.
当前收录版本
0.6.4
质量评测
满分 100。前四项来自 DeepSkill 收录的质量报告。
评分依据
提供完整的部署配置生成能力(Dockerfile、部署清单、环境配置、回滚流程)
评分依据
触发词精准覆盖典型用户提问:“部署设置”、“如何部署此应用”、“部署策略”、“回滚计划”
评分依据
Phase 划分清晰(Step 0~6),逻辑连贯
评分依据
工具来源明确(gcloud/flyctl/kubectl),参数具体
计算方式
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
-
安装或获取外部依赖
使用官方来源并锁定版本,在隔离环境检查安装脚本。当前文档检查不覆盖后续下载的代码。
主文档提及 · 第 78 行 -
调用命令或脚本
先读脚本与参数,使用普通权限和限定目录;安装或执行前由使用工具再次确认。
主文档提及 · 第 396 行 -
云资源与可能的费用
先预览变更,核对账号、区域、资源权限与费用;创建、部署或删除前单独确认。
主文档提及 · 第 183 行
文档引用的域名或地址
这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。
- your-url
安全评级与访问范围
risk · 静态证据核验,不代表运行安全保证。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。