start.sh 835 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. # 项目路径
  3. PROJECT_PATH=/home/centos/okki-oms/jeecg-boot
  4. # 进入项目目录
  5. cd $PROJECT_PATH
  6. # 清理Maven项目
  7. mvn clean
  8. # 打包Maven项目
  9. mvn package -Dmaven.test.skip=true
  10. # 检查包是否生成成功
  11. if [ -f "$PROJECT_PATH/jeecg-module-system/jeecg-system-start/target/jeecg-system-start-3.6.3.jar" ]; then
  12. echo "微服务包生成成功"
  13. else
  14. echo "微服务包生成失败"
  15. exit 1
  16. fi
  17. # 检查Java进程是否存在
  18. PID=$(ps -ef | grep jeecg-system-start-3.6.3.jar | grep -v grep | awk '{print $2}')
  19. if [[ -n ${PID} ]]; then
  20. echo "Java process is running, PID is ${PID}. Killing..."
  21. kill -9 ${PID}
  22. fi
  23. nohup java -jar "$PROJECT_PATH/jeecg-module-system/jeecg-system-start/target/jeecg-system-start-3.6.3.jar" --spring.profiles.active=prod >/home/centos/okki-oms/jeecg-boot/logs/out.log &