mirror of
https://github.com/lkeme/BiliHelper-personal.git
synced 2025-12-19 09:30:10 +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" \
|
||||||
@ -53,4 +55,4 @@ RUN apk add --no-cache git && \
|
|||||||
rm -r /var/cache/apk && \
|
rm -r /var/cache/apk && \
|
||||||
rm -r /usr/share/man
|
rm -r /usr/share/man
|
||||||
|
|
||||||
ENTRYPOINT ["entrypoint.sh"]
|
ENTRYPOINT ["entrypoint.sh"]
|
||||||
|
|||||||
@ -4,49 +4,49 @@ set -e
|
|||||||
# 源切换
|
# 源切换
|
||||||
case ${MIRRORS} in
|
case ${MIRRORS} in
|
||||||
"custom")
|
"custom")
|
||||||
# custom
|
# custom
|
||||||
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-自定义克隆链接 ${Font} \n ======== \n"
|
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-自定义克隆链接 ${Font} \n ======== \n"
|
||||||
git remote set-url origin ${CUSTOM_CLONE_URL}
|
git remote set-url origin ${CUSTOM_CLONE_URL}
|
||||||
;;
|
;;
|
||||||
"0")
|
"0")
|
||||||
# https://github.com/
|
# https://github.com/
|
||||||
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-github.com ${Font} \n ======== \n"
|
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-github.com ${Font} \n ======== \n"
|
||||||
git remote set-url origin https://github.com/lkeme/BiliHelper-personal.git
|
git remote set-url origin https://github.com/lkeme/BiliHelper-personal.git
|
||||||
;;
|
;;
|
||||||
"1")
|
"1")
|
||||||
# https://ghproxy.com/
|
# https://ghproxy.com/
|
||||||
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-ghproxy.com ${Font} \n ======== \n"
|
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-ghproxy.com ${Font} \n ======== \n"
|
||||||
git remote set-url origin https://ghproxy.com/https://github.com/lkeme/BiliHelper-personal.git
|
git remote set-url origin https://ghproxy.com/https://github.com/lkeme/BiliHelper-personal.git
|
||||||
;;
|
;;
|
||||||
"2")
|
"2")
|
||||||
# http://fastgit.org/
|
# http://fastgit.org/
|
||||||
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-hub.fastgit.xyz ${Font} \n ======== \n"
|
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-hub.fastgit.xyz ${Font} \n ======== \n"
|
||||||
git remote set-url origin https://hub.fastgit.xyz/lkeme/BiliHelper-personal.git
|
git remote set-url origin https://hub.fastgit.xyz/lkeme/BiliHelper-personal.git
|
||||||
;;
|
;;
|
||||||
"3")
|
"3")
|
||||||
# https://hub.gitfast.tk/
|
# https://hub.gitfast.tk/
|
||||||
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-hub.gitfast.tk ${Font} \n ======== \n"
|
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-hub.gitfast.tk ${Font} \n ======== \n"
|
||||||
git remote set-url origin https://hub.gitfast.tk/lkeme/BiliHelper-personal.git
|
git remote set-url origin https://hub.gitfast.tk/lkeme/BiliHelper-personal.git
|
||||||
;;
|
;;
|
||||||
"4")
|
"4")
|
||||||
# https://hub.gitslow.tk/
|
# https://hub.gitslow.tk/
|
||||||
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-hub.gitslow.tk ${Font} \n ======== \n"
|
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-hub.gitslow.tk ${Font} \n ======== \n"
|
||||||
git remote set-url origin https://hub.gitslow.tk/lkeme/BiliHelper-personal.git
|
git remote set-url origin https://hub.gitslow.tk/lkeme/BiliHelper-personal.git
|
||||||
;;
|
;;
|
||||||
"5")
|
"5")
|
||||||
# https://hub.verge.tk/
|
# https://hub.verge.tk/
|
||||||
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-hub.verge.tk ${Font} \n ======== \n"
|
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-hub.verge.tk ${Font} \n ======== \n"
|
||||||
git remote set-url origin https://hub.verge.tk/lkeme/BiliHelper-personal.git
|
git remote set-url origin https://hub.verge.tk/lkeme/BiliHelper-personal.git
|
||||||
;;
|
;;
|
||||||
"6")
|
"6")
|
||||||
# https://gh.api.99988866.xyz/
|
# https://gh.api.99988866.xyz/
|
||||||
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-gh.api.99988866.xyz ${Font} \n ======== \n"
|
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-gh.api.99988866.xyz ${Font} \n ======== \n"
|
||||||
git remote set-url origin https://gh.api.99988866.xyz/https://github.com/lkeme/BiliHelper-personal.git
|
git remote set-url origin https://gh.api.99988866.xyz/https://github.com/lkeme/BiliHelper-personal.git
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-github.com ${Font} \n ======== \n"
|
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-github.com ${Font} \n ======== \n"
|
||||||
git remote set-url origin https://github.com/lkeme/BiliHelper-personal.git
|
git remote set-url origin https://github.com/lkeme/BiliHelper-personal.git
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# 拉取更新
|
# 拉取更新
|
||||||
@ -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
|
||||||
echo -e "\n ======== \n ${GreenBG} 正在使用外部配置文件 ${Font} \n ======== \n"
|
"1")
|
||||||
else
|
echo -e "\n ======== \n ${Info} ${GreenBG} 正在使用版本V1方案 ${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
|
if [[ -f ${V1_CONIFG_PATH} ]]; then
|
||||||
sed -i ''"$(cat /app/profile/user/config/user.ini -n | grep "username = \"\"" | awk '{print $1}')"'c '"$(echo "username = \"${USER_NAME}\"")"'' ${CONIFG_PATH}
|
echo -e "\n ======== \n ${GreenBG} 正在使用外部配置文件 ${Font} \n ======== \n"
|
||||||
sed -i ''"$(cat /app/profile/user/config/user.ini -n | grep "password = \"\"" | awk '{print $1}')"'c '"$(echo "password = \"${USER_PASSWORD}\"")"'' ${CONIFG_PATH}
|
else
|
||||||
fi
|
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 app.php m:a
|
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 "
|
||||||
|
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}\"")"'' ${V2_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
|
||||||
|
|
||||||
|
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