deploy

GitHub

通过SSH将ServerKit部署到生产服务器,执行更新、前端重建、服务重启及健康检查,并在失败时提供回滚建议。

.claude/skills/deploy/SKILL.md jhd3197/ServerKit

Trigger Scenarios

向生产环境推送代码变更 执行应用发布流程

Install

npx skills add jhd3197/ServerKit --skill deploy -g -y
More Options

Non-standard path

npx skills add https://github.com/jhd3197/ServerKit/tree/main/.claude/skills/deploy -g -y

Use without installing

npx skills use jhd3197/ServerKit@deploy

指定 Agent (Claude Code)

npx skills add jhd3197/ServerKit --skill deploy -a claude-code -g -y

安装 repo 全部 skill

npx skills add jhd3197/ServerKit --all -g -y

预览 repo 内 skill

npx skills add jhd3197/ServerKit --list

SKILL.md

Frontmatter
{
    "name": "deploy",
    "description": "Deploy ServerKit to the production server via SSH. Runs update, rebuilds frontend, restarts services, and performs health checks. Use when pushing changes to production.",
    "allowed-tools": "mcp__ssh-mcp__exec, mcp__ssh-mcp__sudo-exec, Bash",
    "argument-hint": "[branch]",
    "disable-model-invocation": true
}

Deploy ServerKit to the production server. Target branch: ${ARGUMENTS:-main}

Pre-deploy Checks

  1. Check the current git status locally — warn if there are uncommitted changes
  2. Check if the local branch is ahead of remote — warn if unpushed commits exist

Deploy Steps

Run these on the remote server via SSH MCP:

1. Check current state

serverkit version
serverkit status

2. Run the update

serverkit update --branch ${ARGUMENTS:-main}

This will:

  • Stop services
  • Pull latest code from the target branch
  • Update Python dependencies
  • Sync app templates
  • Rebuild frontend Docker container
  • Restart all services

3. Health check (wait 10 seconds after update)

curl -s http://127.0.0.1:5000/api/v1/system/health
curl -s http://localhost
serverkit status

4. Report results

Report clearly:

  • Previous version vs new version
  • Which branch is deployed
  • Backend status (systemd)
  • Frontend status (Docker)
  • API health check result
  • Any errors from logs: journalctl -u serverkit -n 20 --no-pager

On Failure

If any health check fails:

  1. Show the last 50 lines of backend logs: journalctl -u serverkit -n 50 --no-pager
  2. Show frontend Docker logs: cd /opt/serverkit && docker compose logs --tail=50
  3. Suggest rollback: serverkit update --branch main --force

Version History

  • 46a94c9 Current 2026-08-20 07:49

Same Skill Collection

.claude/skills/audit-less/SKILL.md
.claude/skills/audit-subprocess/SKILL.md
.claude/skills/create-pr/SKILL.md
.claude/skills/db-inspect/SKILL.md
.claude/skills/new-feature/SKILL.md

Metadata

Files
0
Version
46a94c9
Hash
f4dc5465
Indexed
2026-08-20 07:49

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-27 15:08
浙ICP备14020137号-1 $Carte des visiteurs$