[fix(Docker)] clone mirrors

This commit is contained in:
Lkeme 2022-02-19 16:03:43 +08:00
parent fa4ae37159
commit 213c67adcf
3 changed files with 37 additions and 3 deletions

7
DOC.md
View File

@ -192,7 +192,12 @@ $ docker run -itd --rm -v /path/to/your/confFileName.ini:/app/conf/user.ini lkem
```shell script ```shell script
$ -e MIRRORS=0 # 使用 github.com $ -e MIRRORS=0 # 使用 github.com
$ -e MIRRORS=1 # 使用 ghproxy.com $ -e MIRRORS=1 # 使用 ghproxy.com
$ -e MIRRORS=2 # 使用 github.com.cnpmjs.org $ -e MIRRORS=2 # 使用 fastgit.org
$ -e MIRRORS=3 # 使用 hub.gitfast.tk
$ -e MIRRORS=4 # 使用 hub.gitslow.tk
$ -e MIRRORS=5 # 使用 hub.verge.tk
$ -e MIRRORS=6 # 使用 gh.api.99988866.xyz
$ -e MIRRORS=custom -e CUSTOM_CLONE_URL=https://github.com/lkeme/BiliHelper-personal.git # 使用 自定义克隆地址
``` ```
- 相关参数 - 相关参数

View File

@ -6,6 +6,7 @@ LABEL AUTHOR = "Lkeme <Useri@live.cn>"
ENV USER_NAME='' \ ENV USER_NAME='' \
USER_PASSWORD='' \ USER_PASSWORD='' \
REPO_URL='https://github.com/' \ REPO_URL='https://github.com/' \
CUSTOM_CLONE_URL='https://speed.example.com/example/example.git' \
MIRRORS="0" \ MIRRORS="0" \
CONIFG_PATH='/app/conf/user.ini' \ CONIFG_PATH='/app/conf/user.ini' \
Green="\\033[32m" \ Green="\\033[32m" \

View File

@ -3,17 +3,45 @@ set -e
# 源切换 # 源切换
case ${MIRRORS} in case ${MIRRORS} in
"custom")
# custom
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-自定义克隆链接 ${Font} \n ======== \n"
git remote set-url origin ${CUSTOM_CLONE_URL}
;;
"0") "0")
# 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/
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")
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-github.com.cnpmjs.org ${Font} \n ======== \n" # http://fastgit.org/
git remote set-url origin https://github.com.cnpmjs.org/lkeme/BiliHelper-personal.git 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
;;
"3")
# https://hub.gitfast.tk/
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
;;
"4")
# https://hub.gitslow.tk/
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
;;
"5")
# https://hub.verge.tk/
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
;;
"6")
# https://gh.api.99988866.xyz/
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
;; ;;
*) *)
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-github.com ${Font} \n ======== \n" echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-github.com ${Font} \n ======== \n"