-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdevelop.sh
executable file
·36 lines (30 loc) · 915 Bytes
/
develop.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
#scp -P 22022 -r bin keys config root@47.56.172.167:/usr/local/server/api
PROJECT_PATH="/usr/local/server/api/bin"
PROJECT_NAME="qb_web_server"
USER_NAME="root"
HOSTS=("你的服务器地址")
PASSWORD="服务器密码"
echo "Please Input the server password: "
#read -s PASSWORD
echo '------------------build------------------'
make web-server
cp ./bin/qb_web_server ./bin/gin_micro_new
echo '-----------------upload-----------------'
# shellcheck disable=SC2068
for host in ${HOSTS[@]}
do
echo "${host}"
./upload.expect ./bin/${PROJECT_NAME}_new ${USER_NAME} "${host}" ${PASSWORD} ${PROJECT_PATH}
# shellcheck disable=SC2181
if [[ "$?" != 0 ]]; then
exit 2
fi
done
echo '------------------restart-------------------'
# shellcheck disable=SC2068
for host in ${HOSTS[@]}
do
echo "${host}"
./restart.expect ${PROJECT_NAME} ${USER_NAME} "${host}" ${PASSWORD} ${PROJECT_PATH}
done
rm -rf ./bin/gin_micro_new