Skip to content

Commit

Permalink
feat 拆分资源包
Browse files Browse the repository at this point in the history
  • Loading branch information
jxxghp committed Nov 1, 2023
1 parent a0afd86 commit dbba7fc
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 3 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,16 @@ 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 "plugins/"
Move-Item -Path "MoviePilot-Plugins-main/MoviePilot-Plugins-main/plugins/*" -Destination "app/plugins/"
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
Remove-Item -Path "MoviePilot-Resources-main.zip"
Remove-Item -Path "MoviePilot-Resources-main" -Recurse -Force
shell: pwsh

- name: Pyinstaller
Expand Down
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,13 @@ RUN cp -f /app/nginx.conf /etc/nginx/nginx.template.conf \
&& 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/ \
&& rm -rf /MoviePilot-Plugins-main
&& 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 \
&& rm -rf /MoviePilot-Resources-main
EXPOSE 3000
VOLUME [ "/config" ]
ENTRYPOINT [ "/entrypoint" ]
Binary file removed app/helper/sites.cp311-win_amd64.pyd
Binary file not shown.
Binary file removed app/helper/sites.cpython-311-aarch64-linux-gnu.so
Binary file not shown.
Binary file removed app/helper/sites.cpython-311-darwin.so
Binary file not shown.
Binary file removed app/helper/sites.cpython-311-x86_64-linux-gnu.so
Binary file not shown.
1 change: 0 additions & 1 deletion config/sites/user.sites.bin

This file was deleted.

7 changes: 7 additions & 0 deletions update
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ if [ "${MOVIEPILOT_AUTO_UPDATE_DEV}" = "true" ]; then
echo "正在下载插件..."
curl ${CURL_OPTIONS} "https://github.com/jxxghp/MoviePilot-Plugins/archive/refs/heads/main.zip" | busybox unzip -d /tmp -
echo "插件下载成功"
# 下载资源
echo "正在下载资源包..."
curl ${CURL_OPTIONS} "https://github.com/jxxghp/MoviePilot-Resources/archive/refs/heads/main.zip" | busybox unzip -d /tmp -
echo "资源包下载成功"
# 检查前端最新版本
frontend_version=$(curl ${CURL_OPTIONS} "https://api.github.com/repos/jxxghp/MoviePilot-Frontend/releases/latest" | jq -r .tag_name)
if [[ "${frontend_version}" == *v* ]]; then
Expand All @@ -36,6 +40,9 @@ if [ "${MOVIEPILOT_AUTO_UPDATE_DEV}" = "true" ]; then
rm -rf /public
mv /tmp/dist /public
mv /tmp/MoviePilot-Plugins-main/plugins/* /app/app/plugins/
mv /tmp/MoviePilot-Resources-main/resources/* /app/app/helper/
mv /app/app/helper/user.sites.bin /app/config/sites/user.sites.bin
rm -rf /tmp MoviePilot-*
echo "程序更新成功,前端版本:${frontend_version}"
else
echo "前端程序下载失败,继续使用旧的程序来启动..."
Expand Down

0 comments on commit dbba7fc

Please sign in to comment.