forked from lvshiling/Fgame
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
50 lines (44 loc) · 1009 Bytes
/
deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
# 工作目录
WORKPATH=$(pwd)
echo "当前目录$WORKPATH"
# 发布路径
distPath=""
ip=""
port=""
destPath=""
case "$1" in
master)
distPath="deploy/wanshi_master"
ip="192.168.1.123"
port="22"
destPath="~/fgame_master/deploy/"
;;
test)
distPath="deploy/wanshi_test"
ip="47.99.185.231"
port="20000"
destPath="~/fgame/deploy/"
;;
inner_test)
distPath="deploy/wanshi_inner_test"
ip="192.168.1.123"
port="22"
destPath="~/fgame/deploy/"
;;
prod)
distPath="deploy/wanshi"
destPath="~/fgame/deploy/"
;;
check)
distPath="deploy/wanshi_check"
ip="47.110.245.191"
port="22"
destPath="~/fgame/deploy/"
;;
*)
echo "不支持的参数,请输入prod,test,inner_test"
exit 1
esac
echo "发布路径:$WORKPATH/$distPath"
rsync -azP --delete -e "ssh -p $port" "$WORKPATH/$distPath/" root@$ip:$destPath