From de3d3de4117008b8c9126a29c58a4a8dadec03eb Mon Sep 17 00:00:00 2001 From: DDSRem <1448139087@qq.com> Date: Sun, 27 Aug 2023 12:21:12 +0800 Subject: [PATCH 1/5] =?UTF-8?q?feat:=20=E4=BE=9D=E8=B5=96=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E6=B7=BB=E5=8A=A0=E4=BB=A3=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.txt | 3 ++- update | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 0b79c7fd..bb562ac5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -49,4 +49,5 @@ openai~=0.27.2 cacheout~=0.14.1 click~=8.1.6 requests_cache~=0.5.2 -parse==1.19.0 \ No newline at end of file +parse==1.19.0 +PySocks~=1.7.1 \ No newline at end of file diff --git a/update b/update index 6789d830..c6510d75 100644 --- a/update +++ b/update @@ -34,8 +34,23 @@ if [[ "${old_version}" == *APP_VERSION* ]]; then rm -rf /public mv /tmp/dist /public # 重新安装依赖 - pip install -r /app/requirements.txt - echo "程序更新成功,前端版本:${frontend_version},后端版本:${release_version}" + if [ -n "${PROXY_HOST}" ]; then + pip install -r /app/requirements.txt --proxy=${PROXY_HOST} + if [ $? -eq 0 ]; then + echo "安装依赖成功" + echo "程序更新成功,前端版本:${frontend_version},后端版本:${release_version}" + else + echo "安装依赖失败,请重新拉取镜像" + fi + else + pip install -r /app/requirements.txt + if [ $? -eq 0 ]; then + echo "安装依赖成功" + echo "程序更新成功,前端版本:${frontend_version},后端版本:${release_version}" + else + echo "安装依赖失败,请重新拉取镜像" + fi + fi else echo "前端程序下载失败,继续使用旧的程序来启动..." fi From 6206c5f4a3b8ff56ef58bba40fde2ee07f300b90 Mon Sep 17 00:00:00 2001 From: DDSRem <1448139087@qq.com> Date: Sun, 27 Aug 2023 12:29:55 +0800 Subject: [PATCH 2/5] =?UTF-8?q?fix:=20=20=E4=BC=98=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- update | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/update b/update index c6510d75..447157cb 100644 --- a/update +++ b/update @@ -2,9 +2,11 @@ if [ -n "${PROXY_HOST}" ]; then CURL_OPTIONS="-sL -x ${PROXY_HOST}" + PIP_OPTIONS="-r --proxy=${PROXY_HOST}" echo "使用代理更新程序" else CURL_OPTIONS="-sL" + PIP_OPTIONS="-r" echo "不使用代理更新程序" fi @@ -34,22 +36,12 @@ if [[ "${old_version}" == *APP_VERSION* ]]; then rm -rf /public mv /tmp/dist /public # 重新安装依赖 - if [ -n "${PROXY_HOST}" ]; then - pip install -r /app/requirements.txt --proxy=${PROXY_HOST} - if [ $? -eq 0 ]; then - echo "安装依赖成功" - echo "程序更新成功,前端版本:${frontend_version},后端版本:${release_version}" - else - echo "安装依赖失败,请重新拉取镜像" - fi + pip install ${PIP_OPTIONS} /app/requirements.txt + if [ $? -eq 0 ]; then + echo "安装依赖成功" + echo "程序更新成功,前端版本:${frontend_version},后端版本:${release_version}" else - pip install -r /app/requirements.txt - if [ $? -eq 0 ]; then - echo "安装依赖成功" - echo "程序更新成功,前端版本:${frontend_version},后端版本:${release_version}" - else - echo "安装依赖失败,请重新拉取镜像" - fi + echo "安装依赖失败,请重新拉取镜像" fi else echo "前端程序下载失败,继续使用旧的程序来启动..." From bb67e902c5b58b62466fb2bc515207ff1c427235 Mon Sep 17 00:00:00 2001 From: DDSRem <1448139087@qq.com> Date: Sun, 27 Aug 2023 12:36:48 +0800 Subject: [PATCH 3/5] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E9=87=8D?= =?UTF-8?q?=E5=90=AF=E6=9B=B4=E6=96=B0=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 先安装依赖,再替换文件,防止依赖安装失败导致无法正常启动 --- update | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/update b/update index 447157cb..1d4ea41a 100644 --- a/update +++ b/update @@ -25,26 +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 - if [ $? -eq 0 ]; then echo "后端程序下载成功" - # 检查前端最新版本 - frontend_version=$(curl ${CURL_OPTIONS} "https://api.github.com/repos/jxxghp/MoviePilot-Frontend/releases/latest" | jq -r .tag_name) - echo "正在下载前端程序 ${frontend_version}..." - curl ${CURL_OPTIONS} "https://github.com/jxxghp/MoviePilot-Frontend/releases/download/${frontend_version}/dist.zip" | busybox unzip -d /tmp - + # 重新安装依赖 + pip install ${PIP_OPTIONS} /tmp/MoviePilot*/requirements.txt if [ $? -eq 0 ]; then - echo "前端程序下载成功" - rm -rf /app - mv /tmp/MoviePilot* /app - rm -rf /public - mv /tmp/dist /public - # 重新安装依赖 - pip install ${PIP_OPTIONS} /app/requirements.txt + echo "安装依赖成功" + # 检查前端最新版本 + frontend_version=$(curl ${CURL_OPTIONS} "https://api.github.com/repos/jxxghp/MoviePilot-Frontend/releases/latest" | jq -r .tag_name) + 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 - echo "安装依赖成功" - echo "程序更新成功,前端版本:${frontend_version},后端版本:${release_version}" + echo "前端程序下载成功" + rm -rf /app + mv /tmp/MoviePilot* /app + rm -rf /public + mv /tmp/dist /public else - echo "安装依赖失败,请重新拉取镜像" + echo "前端程序下载失败,继续使用旧的程序来启动..." fi + echo "程序更新成功,前端版本:${frontend_version},后端版本:${release_version}" else - echo "前端程序下载失败,继续使用旧的程序来启动..." + echo "安装依赖失败,请重新拉取镜像" fi else echo "后端程序下载失败,继续使用旧的程序来启动..." From 52fac090212fa4c3899e457a4a57a57ae3a9685e Mon Sep 17 00:00:00 2001 From: DDSRem <1448139087@qq.com> Date: Sun, 27 Aug 2023 12:38:03 +0800 Subject: [PATCH 4/5] =?UTF-8?q?fix:=20=20=E6=9B=B4=E6=96=B0=E6=88=90?= =?UTF-8?q?=E5=8A=9F=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update b/update index 1d4ea41a..e2642311 100644 --- a/update +++ b/update @@ -39,10 +39,10 @@ if [[ "${old_version}" == *APP_VERSION* ]]; then mv /tmp/MoviePilot* /app rm -rf /public mv /tmp/dist /public + echo "程序更新成功,前端版本:${frontend_version},后端版本:${release_version}" else echo "前端程序下载失败,继续使用旧的程序来启动..." fi - echo "程序更新成功,前端版本:${frontend_version},后端版本:${release_version}" else echo "安装依赖失败,请重新拉取镜像" fi From 4b23f3f0766cfd40887d9ca721529a56dfb07e74 Mon Sep 17 00:00:00 2001 From: DDSRem <1448139087@qq.com> Date: Sun, 27 Aug 2023 13:01:18 +0800 Subject: [PATCH 5/5] fix: repeat install pysocks --- requirements.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index bb562ac5..0b79c7fd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -49,5 +49,4 @@ openai~=0.27.2 cacheout~=0.14.1 click~=8.1.6 requests_cache~=0.5.2 -parse==1.19.0 -PySocks~=1.7.1 \ No newline at end of file +parse==1.19.0 \ No newline at end of file