chensenlai-server-dev.sh 775 B

12345678910111213141516171819202122232425262728
  1. #!/bash/sh
  2. echo -e "\033[35m 0) into /home/chensenlai/shanp/project/sp-server --> switch branch ... \033[0m"
  3. cd /home/chensenlai/shanp/project/sp-server
  4. # git checkout dev
  5. echo -e "\033[35m 1) into /home/chensenlai/shanp/project/sp-server --> git pull ... \033[0m"
  6. # git pull
  7. if test -z "$1"
  8. then
  9. exit 0
  10. fi
  11. echo " 2) deploy project sp-$1..."
  12. gradle sp-$1:deploy
  13. echo " 3) rsync to chensenlai@47.106.76.248:/srv/server/sp-server"
  14. rsync --delete -avz /home/chensenlai/shanp/project/sp-server/sp-$1/build/deploy/ chensenlai@47.106.76.248:/srv/server/sp-server/sp-$1/lib/
  15. echo " 4) chensenlai@47.106.76.248 sp-$1/run.sh restart..."
  16. ssh -l chensenlai 47.106.76.248 "cd /srv/server/sp-server/sp-$1/; sh /srv/server/sp-server/sp-$1/run.sh restart"
  17. echo done!
  18. exit 0