Merge pull request #291 from DDS-Derek/main

This commit is contained in:
jxxghp 2023-08-27 13:02:11 +08:00 committed by GitHub
commit 9e31c53fa5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

33
update
View File

@ -2,9 +2,11 @@
if [ -n "${PROXY_HOST}" ]; then if [ -n "${PROXY_HOST}" ]; then
CURL_OPTIONS="-sL -x ${PROXY_HOST}" CURL_OPTIONS="-sL -x ${PROXY_HOST}"
PIP_OPTIONS="-r --proxy=${PROXY_HOST}"
echo "使用代理更新程序" echo "使用代理更新程序"
else else
CURL_OPTIONS="-sL" CURL_OPTIONS="-sL"
PIP_OPTIONS="-r"
echo "不使用代理更新程序" echo "不使用代理更新程序"
fi fi
@ -23,21 +25,26 @@ 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 "后端程序下载成功"
# 检查前端最新版本 # 重新安装依赖
frontend_version=$(curl ${CURL_OPTIONS} "https://api.github.com/repos/jxxghp/MoviePilot-Frontend/releases/latest" | jq -r .tag_name) pip install ${PIP_OPTIONS} /tmp/MoviePilot*/requirements.txt
echo "正在下载前端程序 ${frontend_version}..."
curl ${CURL_OPTIONS} "https://github.com/jxxghp/MoviePilot-Frontend/releases/download/${frontend_version}/dist.zip" | busybox unzip -d /tmp -
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo "前端程序下载成功" echo "安装依赖成功"
rm -rf /app # 检查前端最新版本
mv /tmp/MoviePilot* /app frontend_version=$(curl ${CURL_OPTIONS} "https://api.github.com/repos/jxxghp/MoviePilot-Frontend/releases/latest" | jq -r .tag_name)
rm -rf /public echo "正在下载前端程序 ${frontend_version}..."
mv /tmp/dist /public curl ${CURL_OPTIONS} "https://github.com/jxxghp/MoviePilot-Frontend/releases/download/${frontend_version}/dist.zip" | busybox unzip -d /tmp -
# 重新安装依赖 if [ $? -eq 0 ]; then
pip install -r /app/requirements.txt echo "前端程序下载成功"
echo "程序更新成功,前端版本:${frontend_version},后端版本:${release_version}" rm -rf /app
mv /tmp/MoviePilot* /app
rm -rf /public
mv /tmp/dist /public
echo "程序更新成功,前端版本:${frontend_version},后端版本:${release_version}"
else
echo "前端程序下载失败,继续使用旧的程序来启动..."
fi
else else
echo "前端程序下载失败,继续使用旧的程序来启动..." echo "安装依赖失败,请重新拉取镜像"
fi fi
else else
echo "后端程序下载失败,继续使用旧的程序来启动..." echo "后端程序下载失败,继续使用旧的程序来启动..."