mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 23:06:06 +08:00
修改容器启动逻辑
This commit is contained in:
parent
e217ca6d8f
commit
3232f1efa4
|
@ -9,15 +9,11 @@ fix_config
|
||||||
cp -fv $dir_root/docker/front.conf /etc/nginx/conf.d/front.conf
|
cp -fv $dir_root/docker/front.conf /etc/nginx/conf.d/front.conf
|
||||||
echo
|
echo
|
||||||
|
|
||||||
echo -e "======================2. 更新源代码========================\n"
|
echo -e "======================2. 启动nginx========================\n"
|
||||||
ql update "no-restart"
|
|
||||||
echo
|
|
||||||
|
|
||||||
echo -e "======================3. 启动nginx========================\n"
|
|
||||||
nginx -s reload 2>/dev/null || nginx -c /etc/nginx/nginx.conf
|
nginx -s reload 2>/dev/null || nginx -c /etc/nginx/nginx.conf
|
||||||
echo -e "nginx启动成功...\n"
|
echo -e "nginx启动成功...\n"
|
||||||
|
|
||||||
echo -e "======================4. 启动控制面板========================\n"
|
echo -e "======================3. 启动控制面板========================\n"
|
||||||
cd $dir_root
|
cd $dir_root
|
||||||
if [[ $(pm2 info panel 2>/dev/null) ]]; then
|
if [[ $(pm2 info panel 2>/dev/null) ]]; then
|
||||||
pm2 reload panel
|
pm2 reload panel
|
||||||
|
@ -26,7 +22,7 @@ else
|
||||||
fi
|
fi
|
||||||
echo -e "控制面板启动成功...\n"
|
echo -e "控制面板启动成功...\n"
|
||||||
|
|
||||||
echo -e "======================5. 启动定时任务========================\n"
|
echo -e "======================4. 启动定时任务========================\n"
|
||||||
cd $dir_root
|
cd $dir_root
|
||||||
if [[ $(pm2 info schedule 2>/dev/null) ]]; then
|
if [[ $(pm2 info schedule 2>/dev/null) ]]; then
|
||||||
pm2 reload schedule
|
pm2 reload schedule
|
||||||
|
@ -36,7 +32,7 @@ fi
|
||||||
echo -e "定时任务启动成功...\n"
|
echo -e "定时任务启动成功...\n"
|
||||||
|
|
||||||
if [[ $AutoStartBot == true ]]; then
|
if [[ $AutoStartBot == true ]]; then
|
||||||
echo -e "======================6. 启动bot========================\n"
|
echo -e "======================5. 启动bot========================\n"
|
||||||
cd $dir_root
|
cd $dir_root
|
||||||
ql bot
|
ql bot
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -251,7 +251,6 @@ usage() {
|
||||||
|
|
||||||
## 更新qinglong
|
## 更新qinglong
|
||||||
update_qinglong() {
|
update_qinglong() {
|
||||||
local no_restart="$1"
|
|
||||||
echo -e "--------------------------------------------------------------\n"
|
echo -e "--------------------------------------------------------------\n"
|
||||||
[ -f $dir_root/package.json ] && ql_depend_old=$(cat $dir_root/package.json)
|
[ -f $dir_root/package.json ] && ql_depend_old=$(cat $dir_root/package.json)
|
||||||
reset_romote_url ${dir_root} "${github_proxy_url}https://github.com/whyour/qinglong.git"
|
reset_romote_url ${dir_root} "${github_proxy_url}https://github.com/whyour/qinglong.git"
|
||||||
|
@ -288,12 +287,10 @@ update_qinglong() {
|
||||||
cd $dir_root
|
cd $dir_root
|
||||||
rm -rf $dir_root/build && rm -rf $dir_root/dist
|
rm -rf $dir_root/build && rm -rf $dir_root/dist
|
||||||
cp -rf $ql_static_repo/* $dir_root
|
cp -rf $ql_static_repo/* $dir_root
|
||||||
if [[ $no_restart != "no-restart" ]]; then
|
echo -e "重启面板中..."
|
||||||
echo -e "重启面板中..."
|
nginx -s reload 2>/dev/null || nginx -c /etc/nginx/nginx.conf
|
||||||
nginx -s reload 2>/dev/null || nginx -c /etc/nginx/nginx.conf
|
sleep 1
|
||||||
sleep 1
|
reload_pm2
|
||||||
reload_pm2
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo -e "\n更新$dir_root失败,请检查原因...\n"
|
echo -e "\n更新$dir_root失败,请检查原因...\n"
|
||||||
fi
|
fi
|
||||||
|
@ -403,7 +400,7 @@ main() {
|
||||||
log_path="$dir_log/update/${log_time}_$p1.log"
|
log_path="$dir_log/update/${log_time}_$p1.log"
|
||||||
case $p1 in
|
case $p1 in
|
||||||
update)
|
update)
|
||||||
update_qinglong "$2" | tee $log_path
|
update_qinglong | tee $log_path
|
||||||
;;
|
;;
|
||||||
extra)
|
extra)
|
||||||
run_extra_shell | tee -a $log_path
|
run_extra_shell | tee -a $log_path
|
||||||
|
|
Loading…
Reference in New Issue
Block a user