From 41a45b1a8dbef3eeaf0acf92d8e8847b1c75b32f Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sun, 27 Aug 2023 09:12:28 +0800 Subject: [PATCH] =?UTF-8?q?add=20dev=E6=9C=80=E6=96=B0=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=B8=80=E9=94=AE=E5=8D=87=E7=BA=A7=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dev.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 dev.sh diff --git a/dev.sh b/dev.sh new file mode 100644 index 00000000..c3d083a6 --- /dev/null +++ b/dev.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# 更新环境 +apt update +# 安装 Git +apt install -y git curl +# 更新后端代码 +cd / +rm -rf /app +git clone https://github.com/jxxghp/MoviePilot app +pip install -r /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 -sL "https://github.com/jxxghp/MoviePilot-Frontend/releases/download/${frontend_version}/dist.zip" | busybox unzip -d /tmp - +if [ $? -eq 0 ]; then + rm -rf /public + mv /tmp/dist /public + echo "程序更新成功,前端版本:${frontend_version}" +else + echo "前端程序下载失败" +fi +echo "请重启容器生效"