Commit c04bf486 authored by Junling Bu's avatar Junling Bu
Browse files

chore: 利用ShellCheck修改sh脚本

parent af880c98
......@@ -15,17 +15,17 @@ PASSWORD=
if test -z "$PASSWORD"
then
echo "请设置云主机MySQL的root账号密码"
exit -1
exit 1
fi
# 导入数据
cd /home/ubuntu/deploy/db
cd /home/ubuntu/deploy/db || exit 2
mysql -h localhost -u $ROOT -p$PASSWORD < litemall.sql
# 删除storage文件夹内文件
cd /home/ubuntu/deploy/litemall/storage
cd /home/ubuntu/deploy/litemall/storage || exit 2
rm -f ./**
# 重新部署服务
cd /home/ubuntu/deploy/bin
cd /home/ubuntu/deploy/bin || exit 2
sudo ./deploy.sh
\ No newline at end of file
......@@ -15,26 +15,26 @@ ID_RSA=
if test -z "$REMOTE"
then
echo "请设置云主机登录IP地址和账户"
exit -1
exit 1
fi
if test -z "$ID_RSA"
then
echo "请设置云主机登录IP地址和账户"
exit -1
exit 1
fi
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
cd $DIR/../..
cd $DIR/../.. || exit 2
LITEMALL_HOME=$PWD
echo "LITEMALL_HOME $LITEMALL_HOME"
# 项目打包
cd $LITEMALL_HOME
cd $LITEMALL_HOME || exit 2
./deploy/util/package.sh
# 上传云主机
cd $LITEMALL_HOME
cd $LITEMALL_HOME || exit 2
scp -i $ID_RSA -r ./deploy $REMOTE:/home/ubuntu/
# 远程登录云主机并执行reset脚本
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment