qiangdanxitong/服务器部署命令.txt
2026-03-13 10:26:26 +08:00

36 lines
854 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 在服务器上执行以下命令部署最新代码
# 1. 连接到服务器
ssh root@45.192.99.48
# 密码: 1blZllMIp7
# 2. 进入项目目录
cd /opt/designhub
# 3. 如果还没有Git仓库,先初始化
if [ ! -d ".git" ]; then
git init
git remote add origin http://chenpei:jsjj654321@git.1080p.hk/chenpei/qiangdanxitong.git
git fetch origin
git checkout -b main origin/main
else
# 拉取最新代码
git pull origin main
fi
# 4. 构建后端
cd backend
mvn clean package -DskipTests
# 5. 复制JAR文件
cp target/designhub-backend-1.0.0.jar /opt/designhub/designhub.jar
# 6. 重启服务(主服务名为 designhub-backend,designhub 为兼容别名)
systemctl restart designhub-backend
# 7. 检查服务状态
systemctl status designhub-backend
# 8. 查看日志(可选)
journalctl -u designhub-backend -f