Files
jiebanke/backend-java/start-services.sh
aiotagro b2d940e014 docs(deployment): 更新部署文档并添加自动化部署脚本
- 更新了 DEPLOYMENT.md 文档,增加了更多部署细节和说明
- 添加了 Linux 和 Windows 平台的自动化部署脚本
- 更新了 README.md,增加了部署相关说明
- 调整了 .env 文件配置,以适应新的部署流程
- 移除了部分不必要的代码和配置
2025-09-10 14:16:27 +08:00

92 lines
1.8 KiB
Bash
Executable File
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.

#!/bin/bash
# 启动结伴客Java后端服务脚本
# 启动顺序Eureka Server -> 其他服务 -> Gateway
echo "开始启动结伴客Java后端服务..."
# 启动Eureka Server
echo "正在启动Eureka Server..."
cd eureka-server
mvn spring-boot:run > eureka.log 2>&1 &
EUREKA_PID=$!
cd ..
sleep 10
# 启动Auth Service
echo "正在启动Auth Service..."
cd auth-service
mvn spring-boot:run > auth.log 2>&1 &
AUTH_PID=$!
cd ..
sleep 5
# 启动User Service
echo "正在启动User Service..."
cd user-service
mvn spring-boot:run > user.log 2>&1 &
USER_PID=$!
cd ..
sleep 5
# 启动Travel Service
echo "正在启动Travel Service..."
cd travel-service
mvn spring-boot:run > travel.log 2>&1 &
TRAVEL_PID=$!
cd ..
sleep 5
# 启动Animal Service
echo "正在启动Animal Service..."
cd animal-service
mvn spring-boot:run > animal.log 2>&1 &
ANIMAL_PID=$!
cd ..
sleep 5
# 启动Order Service
echo "正在启动Order Service..."
cd order-service
mvn spring-boot:run > order.log 2>&1 &
ORDER_PID=$!
cd ..
sleep 5
# 启动Promotion Service
echo "正在启动Promotion Service..."
cd promotion-service
mvn spring-boot:run > promotion.log 2>&1 &
PROMOTION_PID=$!
cd ..
sleep 5
# 启动Gateway Service
echo "正在启动Gateway Service..."
cd gateway-service
mvn spring-boot:run > gateway.log 2>&1 &
GATEWAY_PID=$!
cd ..
echo "所有服务已启动!"
echo "Eureka Server PID: $EUREKA_PID"
echo "Auth Service PID: $AUTH_PID"
echo "User Service PID: $USER_PID"
echo "Travel Service PID: $TRAVEL_PID"
echo "Animal Service PID: $ANIMAL_PID"
echo "Order Service PID: $ORDER_PID"
echo "Promotion Service PID: $PROMOTION_PID"
echo "Gateway Service PID: $GATEWAY_PID"
echo "服务访问地址:"
echo "Eureka Dashboard: http://localhost:8761"
echo "API Gateway: http://localhost:8080"
echo "API文档: http://localhost:8080/doc.html"