mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-22 22:36:06 +08:00
移除ql restart,读取gitee资源
This commit is contained in:
parent
3373911b7b
commit
1644fb97b4
|
@ -12,12 +12,6 @@ const initData = [
|
|||
).toString()} * * *`,
|
||||
status: CrontabStatus.idle,
|
||||
},
|
||||
{
|
||||
name: '重启并编译面板',
|
||||
command: 'ql restart',
|
||||
schedule: '30 7 */7 * *',
|
||||
status: CrontabStatus.disabled,
|
||||
},
|
||||
{
|
||||
name: '删除日志',
|
||||
command: 'ql rmlog 7',
|
||||
|
|
|
@ -13,18 +13,22 @@ fix_config
|
|||
cp -fv $dir_root/docker/front.conf /etc/nginx/conf.d/front.conf
|
||||
echo
|
||||
|
||||
echo -e "======================3. 启动nginx========================\n"
|
||||
echo -e "======================3. 拉取静态资源========================\n"
|
||||
git clone https://gitee.com/whyour/qinglong-static.git $ql_static_repo
|
||||
echo
|
||||
|
||||
echo -e "======================4. 启动nginx========================\n"
|
||||
nginx -s reload 2>/dev/null || nginx -c /etc/nginx/nginx.conf
|
||||
echo -e "nginx启动成功...\n"
|
||||
|
||||
echo -e "======================4. 启动控制面板========================\n"
|
||||
echo -e "======================5. 启动控制面板========================\n"
|
||||
cd $dir_root
|
||||
pm2 reload panel 2>/dev/null || pm2 start $dir_root/build/app.js -n panel
|
||||
pm2 reload panel 2>/dev/null || pm2 start $dir_root/build/app.js -n panel --watch $dir_root/build
|
||||
echo -e "控制面板启动成功...\n"
|
||||
|
||||
echo -e "======================5. 启动定时任务========================\n"
|
||||
echo -e "======================6. 启动定时任务========================\n"
|
||||
cd $dir_root
|
||||
pm2 reload schedule 2>/dev/null || pm2 start $dir_root/build/schedule.js -n schedule
|
||||
pm2 reload schedule 2>/dev/null || pm2 start $dir_root/build/schedule.js -n schedule --watch $dir_root/build
|
||||
echo -e "定时任务启动成功...\n"
|
||||
|
||||
echo -e "############################################################\n"
|
||||
|
|
|
@ -14,6 +14,7 @@ dir_manual_log=$dir_root/manual_log
|
|||
dir_list_tmp=$dir_log/.tmp
|
||||
dir_code=$dir_log/code
|
||||
dir_update_log=$dir_log/update
|
||||
ql_static_repo=$dir_repo/static
|
||||
|
||||
## 文件
|
||||
file_config_sample=$dir_sample/config.sample.sh
|
||||
|
|
|
@ -244,6 +244,27 @@ update_qinglong() {
|
|||
else
|
||||
echo -e "\n更新$dir_root失败,请检查原因...\n"
|
||||
fi
|
||||
|
||||
local url="https://gitee.com/whyour/qinglong-static.git"
|
||||
if [ -d ${ql_static_repo}/.git ]; then
|
||||
reset_romote_url ${ql_static_repo} ${url}
|
||||
git_pull_scripts ${ql_static_repo}
|
||||
else
|
||||
git_clone_scripts ${url} ${ql_static_repo}
|
||||
fi
|
||||
if [[ $exit_status -eq 0 ]]; then
|
||||
echo -e "\n更新$ql_static_repo成功...\n"
|
||||
cp -rf $ql_static_repo/* $dir_root
|
||||
else
|
||||
echo -e "\n更新$dir_root失败,请检查原因...\n"
|
||||
fi
|
||||
|
||||
if [[ $exit_status -eq 0 ]]; then
|
||||
echo -e "重启青龙面板...\n"
|
||||
sleep 5
|
||||
nginx -s reload 2>/dev/null || nginx -c /etc/nginx/nginx.conf
|
||||
echo -e "重启面板完成...\n"
|
||||
fi
|
||||
}
|
||||
|
||||
## 对比脚本
|
||||
|
@ -295,28 +316,6 @@ gen_list_repo() {
|
|||
cd $dir_current
|
||||
}
|
||||
|
||||
## 重新编译qinglong
|
||||
restart_qinglong() {
|
||||
update_qinglong
|
||||
if [[ $exit_status -eq 0 ]]; then
|
||||
echo -e "重新编译青龙...\n"
|
||||
yarn install --network-timeout 1000000000 || yarn install --registry=https://registry.npm.taobao.org --network-timeout 1000000000
|
||||
yarn build
|
||||
yarn build-back
|
||||
yarn cache clean
|
||||
echo -e "重新编译青龙完成...\n"
|
||||
|
||||
echo -e "重启定时任务...\n"
|
||||
pm2 reload schedule 2>/dev/null || pm2 start $dir_root/build/schedule.js -n schedule
|
||||
echo -e "重启定时完成...\n"
|
||||
|
||||
echo -e "重启青龙面板...\n"
|
||||
pm2 reload panel 2>/dev/null || pm2 start $dir_root/build/app.js -n panel
|
||||
nginx -s reload 2>/dev/null || nginx -c /etc/nginx/nginx.conf
|
||||
echo -e "重启面板完成...\n"
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
local p1=$1
|
||||
local p2=$2
|
||||
|
@ -330,9 +329,6 @@ main() {
|
|||
update_qinglong | tee $log_path
|
||||
run_extra_shell | tee -a $log_path
|
||||
;;
|
||||
restart)
|
||||
restart_qinglong | tee $log_path
|
||||
;;
|
||||
repo)
|
||||
get_user_info
|
||||
local name=$(echo "${p2##*/}" | awk -F "." '{print $1}')
|
||||
|
|
Loading…
Reference in New Issue
Block a user