hxd-deploy

部署霍小钉服务到服务器。自动上传 JAR 文件、备份旧版本、重启服务。

3,891 stars

Best use case

hxd-deploy is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

部署霍小钉服务到服务器。自动上传 JAR 文件、备份旧版本、重启服务。

Teams using hxd-deploy should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/hxd-deploy/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/adtomato/hxd-deploy/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/hxd-deploy/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How hxd-deploy Compares

Feature / Agenthxd-deployStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

部署霍小钉服务到服务器。自动上传 JAR 文件、备份旧版本、重启服务。

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# 霍小钉服务部署工具

自动化部署霍小钉 Spring Boot 服务到远程服务器。

## 触发条件

当用户提到以下关键词时自动触发:
- "部署霍小钉"
- "部署 hxd"
- "部署服务"
- "更新霍小钉"
- "发布霍小钉"
- "hxd 部署"
- "霍小钉上线"

## 部署配置

### 服务器信息
- **IP**: 203.170.59.16
- **用户**: root
- **SSH 私钥**: `~/.ssh/id_ed25519`

### 文件路径
- **本地 JAR**: `D:\springboot\hxd\target\hxd-0.0.1-SNAPSHOT.jar`
- **远程目录**: `/hjxz/hxd-api/lib`
- **远程脚本**: `/hjxz/hxd-api/bin/hxd-api`
- **日志文件**: `/hjxz/hxd-api/logs/wrapper.log`

## 部署步骤

### 1. Maven 打包(新增)

在上传 JAR 之前,先执行 Maven 打包命令:

```powershell
cd "D:\springboot\hxd"
mvn clean package -Pprod -DskipTests
```

打包完成后检查生成的 JAR 文件是否存在。

### 2. 检查本地 JAR 文件

```powershell
Test-Path "D:\springboot\hxd\target\hxd-0.0.1-SNAPSHOT.jar"
```

如果文件不存在,检查 Maven 打包是否成功。

### 3. SSH 连接测试

```powershell
ssh -i "$env:USERPROFILE\.ssh\id_ed25519" -o StrictHostKeyChecking=no root@203.170.59.16 "echo 'SSH connection successful'"
```

### 4. 上传 JAR 文件

```powershell
$timestamp = Get-Date -Format "yyyy-MM-dd-HH-mm"
scp -i "$env:USERPROFILE\.ssh\id_ed25519" -o StrictHostKeyChecking=no "D:\springboot\hxd\target\hxd-0.0.1-SNAPSHOT.jar" "root@203.170.59.16:/hjxz/hxd-api/lib/hxd-0.0.1-SNAPSHOT.jar"
```

### 5. 备份旧版本并替换

```powershell
ssh -i "$env:USERPROFILE\.ssh\id_ed25519" -o StrictHostKeyChecking=no root@203.170.59.16 @"
cd /hjxz/hxd-api/lib
mv hxd.jar hxd.jar.bak$timestamp
mv hxd-0.0.1-SNAPSHOT.jar hxd.jar
"@
```

### 6. 重启服务

```powershell
ssh -i "$env:USERPROFILE\.ssh\id_ed25519" -o StrictHostKeyChecking=no root@203.170.59.16 "/hjxz/hxd-api/bin/hxd-api restart"
```

### 7. 验证服务状态

```powershell
# 检查服务状态
ssh -i "$env:USERPROFILE\.ssh\id_ed25519" -o StrictHostKeyChecking=no root@203.170.59.16 "cat /hjxz/hxd-api/bin/hxd-api.status"

# 检查日志(最近 30 行)
ssh -i "$env:USERPROFILE\.ssh\id_ed25519" -o StrictHostKeyChecking=no root@203.170.59.16 "tail -30 /hjxz/hxd-api/logs/wrapper.log"
```

## 输出要求

部署完成后报告:
1. ✅ JAR 文件上传状态
2. ✅ 备份文件名称(带时间戳)
3. ✅ 服务重启状态(PID、状态)
4. ✅ 服务运行状态(从日志确认)
5. ⚠️ 任何警告或错误信息

## 错误处理

### 常见问题

1. **SSH 连接失败**
   - 检查私钥文件是否存在
   - 检查服务器是否可达
   - 提示用户检查网络或 SSH 配置

2. **JAR 文件不存在**
   - 提示用户先执行 Maven 构建:`mvn clean package`
   - 检查构建路径是否正确

3. **服务启动失败**
   - 查看完整日志:`tail -100 /hjxz/hxd-api/logs/wrapper.log`
   - 检查端口占用:`netstat -tlnp | grep 9999`
   - 检查磁盘空间:`df -h`

4. **备份失败**
   - 检查文件权限
   - 检查磁盘空间

## 示例对话

**用户**: 部署一下霍小钉服务

**助手**: 好的,开始部署霍小钉服务...
- ✅ JAR 文件已上传
- ✅ 旧版本备份为 hxd.jar.bak2026-03-25-16-56
- ✅ 服务已重启,PID: 21499,状态:STARTED
- ✅ 服务正常运行,端口 9999

部署完成!🫘

---

## 注意事项

1. **部署时间**: 避免在业务高峰期部署(工作日 9:00-18:00)
2. **备份保留**: 保留最近 2-3 个备份版本,避免磁盘占满
3. **日志检查**: 每次部署后必须检查日志确认服务正常
4. **回滚方案**: 如需回滚,将备份文件改名为 hxd.jar 后重启服务

## 快速回滚命令

```powershell
# 回滚到上一个版本
ssh -i "$env:USERPROFILE\.ssh\id_ed25519" -o StrictHostKeyChecking=no root@203.170.59.16 @"
cd /hjxz/hxd-api/lib
ls -lt hxd.jar.bak* | head -1 | awk '{print \$NF}' | xargs -I {} cp {} hxd.jar
/hjxz/hxd-api/bin/hxd-api restart
"@
```

Related Skills

Multi-Agent Deployment Skill for OpenClaw

3891
from openclaw/skills

Deploy a production-ready multi-agent fleet in OpenClaw. Includes step-by-step setup guide, workspace templates, and Python automation scripts for agent creation, routing config, memory sync, and cloud deployment — based on a real working 4-agent production setup.

openclaw-deploy-tracker

3891
from openclaw/skills

记录和查询 OpenClaw 生态的部署服务。当需要新增部署、查询现有服务、更新服务状态、检查依赖关系时使用。规范记录格式,提供查询和写入的工作流。无需凭证。

multi-bot-deploy

3891
from openclaw/skills

OpenClaw 多 Bot 多 Agent 一键搭建技能。根据用户提供的 Bot 名称、职能、模型和飞书凭证,自动完成 Agent 创建、账号配置、路由绑定和验证测试全流程。

appdeploy

3891
from openclaw/skills

Deploy web apps with backend APIs, database, file storage, AI operations, authentication, realtime, and cron jobs. Use when the user asks to deploy or publish a website or web app and wants a public URL. Uses HTTP API via curl.

azion-deploy

3891
from openclaw/skills

Deploy applications, static sites, and edge functions to Azion using Azion CLI. Use when the user asks to deploy/publish to Azion, configure link/build/deploy flow, or troubleshoot Azion auth/project linking problems.

xcloud-docker-deploy

3891
from openclaw/skills

Deploy any project to xCloud hosting — auto-detects stack (WordPress, Laravel, PHP, Node.js, Next.js, NestJS, Python, Go, Rust), routes to native or Docker deployment, generates production-ready Dockerfile, docker-compose.yml, GitHub Actions CI/CD, and .env.example. Works from zero Docker setup.

CursorWindsurfCodex

setup-deploy

3891
from openclaw/skills

Configure deployment settings for land-and-deploy. Detects your deploy platform (Fly.io, Render, Vercel, Netlify, Heroku, GitHub Actions, custom), production URL, health check endpoints, and deploy commands. Use when: "setup deploy", "configure deployment", "set up land-and-deploy", "how do I deploy".

land-and-deploy

3891
from openclaw/skills

Land and deploy workflow. Merges the PR, waits for CI and deploy, verifies production health via canary checks. Takes over after /ship creates the PR.

AgentStead Deploy Skill

3891
from openclaw/skills

Deploy and manage AI agents on [AgentStead](https://agentstead.com) cloud hosting.

inspirai-deploy

3891
from openclaw/skills

智能部署工具 - 自动检测部署策略,预检查、发布、监控一体化。支持 K8s/Helm、Docker Compose、Vercel、Fly.io。Triggers: '部署', 'deploy', '发布', '上线', '预检查', '部署监控', 'helm upgrade', 'docker compose up'.

rocm_vllm_deployment

3891
from openclaw/skills

Production-ready vLLM deployment on AMD ROCm GPUs. Combines environment auto-check, model parameter detection, Docker Compose deployment, health verification, and functional testing with comprehensive logging and security best practices.

check-deployment-status

3891
from openclaw/skills

Check deployment status of PRs and commits using continuous-deployment MCP and UCS deployer MCP. Use when user asks "is this deployed", "check deployment", "deployment status", "is PR merged and deployed", "check UP status", "introduced to production", or provides a GitHub PR URL and wants deployment info.