brain-server-prod.sh 809 B

1234567891011121314151617181920212223242526272829
  1. #!/bash/sh
  2. echo -e "\033[35m 0) into /home/chensenlai/shanp/project/brain-server --> switch branch ... \033[0m"
  3. cd /home/chensenlai/shanp/project/brain-server
  4. #git checkout master
  5. echo -e "\033[35m 1) into /home/chensenlai/shanp/project/brain-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 brain-$1..."
  12. #gradle eclipse
  13. gradle brain-$1:deploy
  14. echo " 3) rsync to bru@119.23.70.213:/srv/server/brain-server"
  15. rsync --delete -avz /home/chensenlai/shanp/project/brain-server/brain-$1/build/deploy/ bru@119.23.70.213:/srv/server/brain-server/brain-$1/lib/
  16. echo " 4) bru@119.23.70.213 brain-$1/run.sh restart..."
  17. ssh -l bru 119.23.70.213 "cd /srv/server/brain-server/brain-$1/; sh /srv/server/brain-server/brain-$1/run.sh restart"
  18. echo done!
  19. exit 0