feat: 优化重启更新逻辑
先安装依赖,再替换文件,防止依赖安装失败导致无法正常启动
This commit is contained in:
parent
6206c5f4a3
commit
bb67e902c5
14
update
14
update
@ -25,6 +25,10 @@ if [[ "${old_version}" == *APP_VERSION* ]]; then
|
|||||||
curl ${CURL_OPTIONS} "https://github.com/jxxghp/MoviePilot/archive/refs/tags/${release_version}.zip" | busybox unzip -d /tmp -
|
curl ${CURL_OPTIONS} "https://github.com/jxxghp/MoviePilot/archive/refs/tags/${release_version}.zip" | busybox unzip -d /tmp -
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "后端程序下载成功"
|
echo "后端程序下载成功"
|
||||||
|
# 重新安装依赖
|
||||||
|
pip install ${PIP_OPTIONS} /tmp/MoviePilot*/requirements.txt
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "安装依赖成功"
|
||||||
# 检查前端最新版本
|
# 检查前端最新版本
|
||||||
frontend_version=$(curl ${CURL_OPTIONS} "https://api.github.com/repos/jxxghp/MoviePilot-Frontend/releases/latest" | jq -r .tag_name)
|
frontend_version=$(curl ${CURL_OPTIONS} "https://api.github.com/repos/jxxghp/MoviePilot-Frontend/releases/latest" | jq -r .tag_name)
|
||||||
echo "正在下载前端程序 ${frontend_version}..."
|
echo "正在下载前端程序 ${frontend_version}..."
|
||||||
@ -35,17 +39,13 @@ if [[ "${old_version}" == *APP_VERSION* ]]; then
|
|||||||
mv /tmp/MoviePilot* /app
|
mv /tmp/MoviePilot* /app
|
||||||
rm -rf /public
|
rm -rf /public
|
||||||
mv /tmp/dist /public
|
mv /tmp/dist /public
|
||||||
# 重新安装依赖
|
else
|
||||||
pip install ${PIP_OPTIONS} /app/requirements.txt
|
echo "前端程序下载失败,继续使用旧的程序来启动..."
|
||||||
if [ $? -eq 0 ]; then
|
fi
|
||||||
echo "安装依赖成功"
|
|
||||||
echo "程序更新成功,前端版本:${frontend_version},后端版本:${release_version}"
|
echo "程序更新成功,前端版本:${frontend_version},后端版本:${release_version}"
|
||||||
else
|
else
|
||||||
echo "安装依赖失败,请重新拉取镜像"
|
echo "安装依赖失败,请重新拉取镜像"
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
echo "前端程序下载失败,继续使用旧的程序来启动..."
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo "后端程序下载失败,继续使用旧的程序来启动..."
|
echo "后端程序下载失败,继续使用旧的程序来启动..."
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user