-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy_prod_aliyun.sh
64 lines (53 loc) · 1.98 KB
/
deploy_prod_aliyun.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
gulp build:prod
####### CDN
cdnstr="/data/work/asset/m"
#site1
rsync -rvltOD ./dist/* ali-rong-proxy-01:$cdnstr
rsync -rvltOD ./dist/* ali-rong-php-01:$cdnstr
rsync -rvltOD ./dist/* ali-rong-tomcat-01:$cdnstr
rsync -rvltOD ./dist/* ali-rong-api-01:$cdnstr
#site2
rsync -rvltOD ./dist/* ali-rong-proxy-02:$cdnstr
rsync -rvltOD ./dist/* ali-rong-php-02:$cdnstr
rsync -rvltOD ./dist/* ali-rong-tomcat-02:$cdnstr
rsync -rvltOD ./dist/* ali-rong-api-02:$cdnstr
###### 业务逻辑
pathstr="/data/work/frontend/prod/36kr/krplus/dist/m"
if [ $1 = 'site1' ]; then
rsync -rvltOD ./dist/* ali-rong-proxy-01:$pathstr
rsync -rvltOD ./dist/* ali-rong-php-01:$pathstr
rsync -rvltOD ./dist/* ali-rong-tomcat-01:$pathstr
rsync -rvltOD ./dist/* ali-rong-api-01:$pathstr
elif [ $1 = 'site2' ]; then
rsync -rvltOD ./dist/* ali-rong-proxy-02:$pathstr
rsync -rvltOD ./dist/* ali-rong-php-02:$pathstr
rsync -rvltOD ./dist/* ali-rong-tomcat-02:$pathstr
rsync -rvltOD ./dist/* ali-rong-api-02:$pathstr
elif [ $1 = 'all' ]; then
rsync -rvltOD ./dist/* ali-rong-proxy-01:$pathstr
rsync -rvltOD ./dist/* ali-rong-php-01:$pathstr
rsync -rvltOD ./dist/* ali-rong-tomcat-01:$pathstr
rsync -rvltOD ./dist/* ali-rong-api-01:$pathstr
rsync -rvltOD ./dist/* ali-rong-proxy-02:$pathstr
rsync -rvltOD ./dist/* ali-rong-php-02:$pathstr
rsync -rvltOD ./dist/* ali-rong-tomcat-02:$pathstr
rsync -rvltOD ./dist/* ali-rong-api-02:$pathstr
elif [ $1 = 'sim' ]; then
rsync -rvltOD ./dist/* ali-rong-sim-01:$pathstr
elif [ $1 = 'alpha' ]; then
rsync -rvltOD ./dist/* ali-rong-alpha-01:$pathstr
fi
#gulp build:prod
#rsync -rvltOD ./dist/* dev05:/data/work/asset/m
#rsync -rvltOD ./dist/* dev06:/data/work/asset/m
#
#oldIFS="$IFS"
#IFS="&"
#arr=("$1")
#for i in ${arr[@]}
#do
#ssh dev${i} 'cd /data/work/frontend/prod/36kr/krplus;tar zcf m$(date +%Y%m%d%H%M%S).tar.gz dist/m/;exit;'
#rsync -rvltOD ./dist/* dev${i}:/data/work/frontend/prod/36kr/krplus/dist/m
#done;
#IFS="$oldIFS"