-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
57 lines (50 loc) · 1007 Bytes
/
run.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
#!/bin/bash
if [ "$1" = "build" ]
then {
if [ "$2" = "pc" ]; then
npm run build
tar -cJvf pc.tar.xz build
echo "编译完成 PC"
exit 1
fi
if [ "$2" == "mobile" ]; then
npm run build:mobile
tar -cJvf mobile.tar.xz build
echo "编译完成 Mobile"
exit 1
fi
echo "未找到需要编译的服务"
exit 1
}
fi
if [ "$1" == "deploy" ]
then {
if [ "$2" == "pc" ]; then
mkdir -p ./build/pc
tar -xvf pc.tar.xz -C ./build/pc --strip-components 1
echo "部署成功 PC"
exit 1
fi
if [ "$2" == "mobile" ]; then
mkdir -p ./build/mobile
tar -xvf mobile.tar.xz -C ./build/mobile --strip-components 1
echo "部署成功 MOBILE"
exit 1
fi
echo "未找到需要部署的服务"
exit 1
}
fi
if [ "$1" == "push" ]
then {
sh run.sh build pc
sh run.sh build mobile
rm -rf build
git status
git add -A
git commit -m "$2"
git push codeing master
exit 1
}
fi
echo ">>> 未能处理成功"