mirror of
https://github.com/lkeme/BiliHelper-personal.git
synced 2025-12-20 10:30:05 +08:00
[update] docker support v1/v2
This commit is contained in:
parent
182d7d4df8
commit
c69b903ca2
@ -8,7 +8,9 @@ ENV USER_NAME='' \
|
|||||||
REPO_URL='https://github.com/' \
|
REPO_URL='https://github.com/' \
|
||||||
CUSTOM_CLONE_URL='https://speed.example.com/example/example.git' \
|
CUSTOM_CLONE_URL='https://speed.example.com/example/example.git' \
|
||||||
MIRRORS="0" \
|
MIRRORS="0" \
|
||||||
CONIFG_PATH='/app/profile/user/config/user.ini' \
|
VERSION="2"
|
||||||
|
V1_CONIFG_PATH='/app/conf/user.ini' \
|
||||||
|
V2_CONIFG_PATH='/app/profile/user/config/user.ini' \
|
||||||
Green="\\033[32m" \
|
Green="\\033[32m" \
|
||||||
Red="\\033[31m" \
|
Red="\\033[31m" \
|
||||||
GreenBG="\\033[42;37m" \
|
GreenBG="\\033[42;37m" \
|
||||||
|
|||||||
@ -58,14 +58,37 @@ echo -e "\n ======== \n ${Info} ${GreenBG} 安装/更新 项目运行依赖 ${Fo
|
|||||||
php composer.phar install
|
php composer.phar install
|
||||||
echo -e "\n \n \n \n"
|
echo -e "\n \n \n \n"
|
||||||
|
|
||||||
# 判断类型
|
# 版本切换
|
||||||
if [[ -f ${CONIFG_PATH} ]]; then
|
case ${VERSION} in
|
||||||
|
"1")
|
||||||
|
echo -e "\n ======== \n ${Info} ${GreenBG} 正在使用版本V1方案 ${Font} \n ======== \n"
|
||||||
|
# 判断类型
|
||||||
|
if [[ -f ${V1_CONIFG_PATH} ]]; then
|
||||||
echo -e "\n ======== \n ${GreenBG} 正在使用外部配置文件 ${Font} \n ======== \n"
|
echo -e "\n ======== \n ${GreenBG} 正在使用外部配置文件 ${Font} \n ======== \n"
|
||||||
else
|
else
|
||||||
|
echo -e "${OK} ${GreenBG} 正在使用传入的环境变量进行用户配置。\n 如果需要配置更多选择项,请通过挂载配置文件来传入。具体参考项目中的README。\n https://github.com/lkeme/BiliHelper-personal.git ${Font} \n ======== \n "
|
||||||
|
cp /app/conf/user.ini.example /app/conf/user.ini
|
||||||
|
sed -i ''"$(cat /app/conf/user.ini -n | grep "username = \"\"" | awk '{print $1}')"'c '"$(echo "username = \"${USER_NAME}\"")"'' ${V1_CONIFG_PATH}
|
||||||
|
sed -i ''"$(cat /app/conf/user.ini -n | grep "password = \"\"" | awk '{print $1}')"'c '"$(echo "password = \"${USER_PASSWORD}\"")"'' ${V1_CONIFG_PATH}
|
||||||
|
fi
|
||||||
|
|
||||||
|
php index.php
|
||||||
|
;;
|
||||||
|
"2")
|
||||||
|
echo -e "\n ======== \n ${Info} ${GreenBG} 正在使用版本V2方案 ${Font} \n ======== \n"
|
||||||
|
# 判断类型
|
||||||
|
if [[ -f ${V2_CONIFG_PATH} ]]; then
|
||||||
|
echo -e "\n ======== \n ${GreenBG} 正在使用外部配置文件 ${Font} \n ======== \n"
|
||||||
|
else
|
||||||
echo -e "${OK} ${GreenBG} 正在使用传入的环境变量进行用户配置。\n 如果需要配置更多选择项,请通过挂载配置文件来传入。具体参考项目中的README。\n https://github.com/lkeme/BiliHelper-personal.git ${Font} \n ======== \n "
|
echo -e "${OK} ${GreenBG} 正在使用传入的环境变量进行用户配置。\n 如果需要配置更多选择项,请通过挂载配置文件来传入。具体参考项目中的README。\n https://github.com/lkeme/BiliHelper-personal.git ${Font} \n ======== \n "
|
||||||
cp /app/profile/example /app/profile/user
|
cp /app/profile/example /app/profile/user
|
||||||
sed -i ''"$(cat /app/profile/user/config/user.ini -n | grep "username = \"\"" | awk '{print $1}')"'c '"$(echo "username = \"${USER_NAME}\"")"'' ${CONIFG_PATH}
|
sed -i ''"$(cat /app/profile/user/config/user.ini -n | grep "username = \"\"" | awk '{print $1}')"'c '"$(echo "username = \"${USER_NAME}\"")"'' ${V2_CONIFG_PATH}
|
||||||
sed -i ''"$(cat /app/profile/user/config/user.ini -n | grep "password = \"\"" | awk '{print $1}')"'c '"$(echo "password = \"${USER_PASSWORD}\"")"'' ${CONIFG_PATH}
|
sed -i ''"$(cat /app/profile/user/config/user.ini -n | grep "password = \"\"" | awk '{print $1}')"'c '"$(echo "password = \"${USER_PASSWORD}\"")"'' ${V2_CONIFG_PATH}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
php app.php m:a
|
php app.php m:a
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo -e "\n ======== \n ${Info} ${RedBG} 错误的版本方案选择 ${Font} \n ======== \n"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|||||||
@ -191,6 +191,13 @@ $ docker run -itd --rm -e USER_NAME=你的B站登录账号 -e USER_PASSWORD=你
|
|||||||
$ docker run -itd --rm -v /path/to/your/confFilePath:/app/profile/user lkeme/bilihelper-personal
|
$ docker run -itd --rm -v /path/to/your/confFilePath:/app/profile/user lkeme/bilihelper-personal
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- 版本兼容
|
||||||
|
|
||||||
|
```shell script
|
||||||
|
$ -e VERSION=1 # 使用 版本 V1.x.x
|
||||||
|
$ -e MIRRORS=2 # 使用 版本 V2.x.x(默认)
|
||||||
|
```
|
||||||
|
|
||||||
- 使用github镜像加速
|
- 使用github镜像加速
|
||||||
|
|
||||||
```shell script
|
```shell script
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user