#!/bash/sh echo -e "\033[35m 0) into /home/chensenlai/shanp/project/sp-server --> switch branch ... \033[0m" cd /home/chensenlai/shanp/project/sp-server # git checkout dev echo -e "\033[35m 1) into /home/chensenlai/shanp/project/sp-server --> git pull ... \033[0m" # git pull if test -z "$1" then exit 0 fi echo " 2) deploy project sp-$1..." gradle sp-$1:deploy echo " 3) rsync to chensenlai@47.106.76.248:/srv/server/sp-server" 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/ echo " 4) chensenlai@47.106.76.248 sp-$1/run.sh restart..." ssh -l chensenlai 47.106.76.248 "cd /srv/server/sp-server/sp-$1/; sh /srv/server/sp-server/sp-$1/run.sh restart" echo done! exit 0