Skip to content

Commit 41a45b1

Browse files
committed
add dev最新代码一键升级脚本
1 parent 66c7ca0 commit 41a45b1

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

dev.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
# 更新环境
3+
apt update
4+
# 安装 Git
5+
apt install -y git curl
6+
# 更新后端代码
7+
cd /
8+
rm -rf /app
9+
git clone https://github.com/jxxghp/MoviePilot app
10+
pip install -r /app/requirements.txt
11+
echo "后端程序更新成功"
12+
# 检查前端最新版本
13+
frontend_version=$(curl ${CURL_OPTIONS} "https://api.github.com/repos/jxxghp/MoviePilot-Frontend/releases/latest" | jq -r .tag_name)
14+
# 更新前端代码
15+
echo "正在下载前端程序 ${frontend_version}..."
16+
curl -sL "https://github.com/jxxghp/MoviePilot-Frontend/releases/download/${frontend_version}/dist.zip" | busybox unzip -d /tmp -
17+
if [ $? -eq 0 ]; then
18+
rm -rf /public
19+
mv /tmp/dist /public
20+
echo "程序更新成功,前端版本:${frontend_version}"
21+
else
22+
echo "前端程序下载失败"
23+
fi
24+
echo "请重启容器生效"

0 commit comments

Comments
 (0)