shebao-server-prod.sh 630 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. echo -e "\033[35m 1) git pull... \033[0m"
  3. cd /srv/source/shebao-server
  4. #git pull
  5. #git checkout dev
  6. #git pull
  7. echo -e "\033[35m 2) deploy project shebao-$1... \033[0m"
  8. #gradle eclipse
  9. gradle shebao-$1:deploy
  10. echo -e "\033[35m 3) rsync to shebao@120.78.163.135:/usr/server/shebao-$1/lib/ \033[0m"
  11. rsync --delete -avz /srv/source/shebao-server/shebao-$1/build/deploy/ shebao@120.78.163.135:/usr/server/shebao-$1/lib/
  12. echo -e "\033[35m 4) remote shebao-$1 restart... \033[0m"
  13. ssh shebao@120.78.163.135 > /dev/null 2>&1 << eenndd
  14. cd /usr/server/shebao-$1
  15. sh run.sh restart
  16. exit
  17. eenndd
  18. echo done!
  19. exit 0