Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
jxxghp committed Nov 1, 2023
1 parent 01aa381 commit 155aa25
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,12 @@ jobs:
New-Item -Path "nginx/logs/__keep__.txt" -ItemType File -Force
Invoke-WebRequest -Uri "https://github.com/jxxghp/MoviePilot-Plugins/archive/refs/heads/main.zip" -OutFile "MoviePilot-Plugins-main.zip"
Expand-Archive -Path "MoviePilot-Plugins-main.zip" -DestinationPath "MoviePilot-Plugins-main"
Move-Item -Path "MoviePilot-Plugins-main/MoviePilot-Plugins-main/plugins/*" -Destination "app/plugins/"
Move-Item -Path "MoviePilot-Plugins-main/MoviePilot-Plugins-main/plugins/*" -Destination "app/plugins/" -Force
Remove-Item -Path "MoviePilot-Plugins-main.zip"
Remove-Item -Path "MoviePilot-Plugins-main" -Recurse -Force
Invoke-WebRequest -Uri "https://github.com/jxxghp/MoviePilot-Resources/archive/refs/heads/main.zip" -OutFile "MoviePilot-Resources-main.zip"
Expand-Archive -Path "MoviePilot-Resources-main.zip" -DestinationPath "MoviePilot-Resources-main"
Move-Item -Path "MoviePilot-Resources-main/MoviePilot-Resources-main/resources/*" -Destination "app/helper/"
New-Item -Path "config/sites" -ItemType Directory -Force
Move-Item -Path "app/helper/user.sites.bin" -Destination "config/sites/user.sites.bin" -Force
Move-Item -Path "MoviePilot-Resources-main/MoviePilot-Resources-main/resources/*" -Destination "app/helper/" -Force
Remove-Item -Path "MoviePilot-Resources-main.zip"
Remove-Item -Path "MoviePilot-Resources-main" -Recurse -Force
shell: pwsh
Expand Down
7 changes: 2 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,10 @@ RUN cp -f /app/nginx.conf /etc/nginx/nginx.template.conf \
&& curl -sL "https://github.com/jxxghp/MoviePilot-Frontend/releases/download/${FRONTEND_VERSION}/dist.zip" | busybox unzip -d / - \
&& mv /dist /public \
&& curl -sL "https://github.com/jxxghp/MoviePilot-Plugins/archive/refs/heads/main.zip" | busybox unzip -d / - \
&& mv /MoviePilot-Plugins-main/plugins/* /app/app/plugins/ \
&& mv -f /MoviePilot-Plugins-main/plugins/* /app/app/plugins/ \
&& rm -rf /MoviePilot-Plugins-main \
&& curl -sL "https://github.com/jxxghp/MoviePilot-Resources/archive/refs/heads/main.zip" | busybox unzip -d / - \
&& mv /MoviePilot-Resources-main/resources/* /app/app/helper/ \
&& rm -f /app/config/user.sites.bin \
&& mkdir -p /app/config/sites \
&& mv /app/app/helper/user.sites.bin /app/config/sites/user.sites.bin \
&& mv -f /MoviePilot-Resources-main/resources/* /app/app/helper/ \
&& rm -rf /MoviePilot-Resources-main
EXPOSE 3000
VOLUME [ "/config" ]
Expand Down
4 changes: 3 additions & 1 deletion app/helper/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ def install(pid: str, repo_url: str) -> Tuple[bool, str]:
if item.get("download_url"):
# 下载插件文件
res = RequestUtils(proxies=settings.PROXY).get_res(item["download_url"])
if not res or res.status_code != 200:
if not res:
return False, f"文件 {item.get('name')} 下载失败!"
elif res.status_code != 200:
return False, f"下载文件 {item.get('name')} 失败:{res.status_code} - {res.reason}"
# 创建插件文件夹
file_path = Path(settings.ROOT_PATH) / "app" / item.get("path")
Expand Down
6 changes: 2 additions & 4 deletions update
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ install_backend_and_download_resources() {
mv /tmp/App /app
rm -rf /public
mv /tmp/dist /public
mv /tmp/Plugins/plugins/* /app/app/plugins/
mv /tmp/Resources/resources/* /app/app/helper/
mkdir -p /app/config/sites
mv /app/app/helper/user.sites.bin /app/config/sites/user.sites.bin
mv -f /tmp/Plugins/plugins/* /app/app/plugins/
mv -f /tmp/Resources/resources/* /app/app/helper/
rm -rf /tmp/*
echo "程序更新成功,前端版本:${frontend_version},后端版本:${1}"
else
Expand Down

0 comments on commit 155aa25

Please sign in to comment.