forked from OpenBMB/XAgent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish_test
executable file
·42 lines (31 loc) · 921 Bytes
/
publish_test
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
#!/usr/bin/env sh
PACKAGE_NAME=$1
TYPE=$2
# TEST_HOST=172.16.3.74
TEST_HOST=web-1.prod.modelbest.co
PROD_HOST=frontend-1.prod.modelbest.co
if [ $TYPE == "test" ]; then
echo test
scp "./${PACKAGE_NAME}.test.zip" root@${TEST_HOST}:/mnt/frontend/openapi
if [ $? -eq 0 ]; then
echo "succeed"
ssh root@${TEST_HOST} "cd /mnt/frontend/openapi; rm -r dist;unzip -o -q ${PACKAGE_NAME}.${TYPE}.zip;"
if [ $? -eq 0 ]; then
echo "publish success"
fi
else
echo "failed"
fi
else
echo prod
scp "./${PACKAGE_NAME}.zip" root@${PROD_HOST}:/opt/front/openapi
if [ $? -eq 0 ]; then
echo "succeed"
ssh root@${PROD_HOST} "cd /opt/front/openapi; unzip -o -q ${PACKAGE_NAME}.zip;"
if [ $? -eq 0 ]; then
echo "publish success"
fi
else
echo "failed"
fi
fi