sync.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/sh
  2. # 克隆项目源码,编译打包,部署到服务器
  3. CURRENT_DIR=`pwd`
  4. PROJECT_NAME="cooleshow"
  5. PROJECT_LIBS="libs"
  6. # 进入项目目录
  7. cd ${PROJECT_NAME}
  8. # 复制项目jar包到服务器
  9. rm -rf ${CURRENT_DIR}/${PROJECT_LIBS} && mkdir -p ${CURRENT_DIR}/${PROJECT_LIBS}
  10. echo "create jar dir done"
  11. cp service.md \
  12. cooleshow-user/user-admin/target/user-admin.jar \
  13. audio-analysis/target/audio-analysis.jar \
  14. cooleshow-auth/auth-server/target/auth-server.jar \
  15. cooleshow-bbs/target/cooleshow-bbs.jar \
  16. cooleshow-user/user-classroom/target/user-classroom.jar \
  17. cooleshow-cms/target/cooleshow-cms.jar \
  18. cooleshow-gateway/gateway-web/target/gateway-web.jar \
  19. cooleshow-mall/mall-admin/target/mall-admin.jar \
  20. cooleshow-mall/mall-portal/target/mall-portal.jar \
  21. cooleshow-user/user-student/target/user-student.jar \
  22. cooleshow-task/target/cooleshow-task.jar \
  23. cooleshow-user/user-teacher/target/user-teacher.jar \
  24. cooleshow-user/user-website/target/user-website.jar \
  25. cooleshow-user/user-tenant/target/user-tenant.jar \
  26. cooleshow-websocket/target/cooleshow-websocket.jar \
  27. cooleshow-app/target/cooleshow-app.jar \
  28. ${CURRENT_DIR}/${PROJECT_LIBS}/
  29. echo "copy jar done"
  30. # 服务启动
  31. if [ -f ${CURRENT_DIR}/jenkins-server.sh ];then
  32. echo "./jenkins-server.sh server"
  33. cd ${CURRENT_DIR} && ./jenkins-server.sh server
  34. else
  35. echo "jenkins-server.sh not exist"
  36. exit 1;
  37. fi