Skip to content

Commit

Permalink
[fix(Docker)] clone mirrors
Browse files Browse the repository at this point in the history
  • Loading branch information
lkeme committed Feb 19, 2022
1 parent 293e3de commit 75c62e7
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
7 changes: 6 additions & 1 deletion DOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,12 @@ $ docker run -itd --rm -v /path/to/your/confFileName.ini:/app/conf/user.ini lkem
```shell script
$ -e MIRRORS=0 # 使用 github.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 # 使用 自定义克隆地址
```

- 相关参数
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ LABEL AUTHOR = "Lkeme <Useri@live.cn>"
ENV USER_NAME='' \
USER_PASSWORD='' \
REPO_URL='https://github.com/' \
CUSTOM_CLONE_URL='https://speed.example.com/example/example.git' \
MIRRORS="0" \
CONIFG_PATH='/app/conf/user.ini' \
Green="\\033[32m" \
Expand Down
32 changes: 30 additions & 2 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,45 @@ set -e

# 源切换
case ${MIRRORS} in
"custom")
# custom
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-自定义克隆链接 ${Font} \n ======== \n"
git remote set-url origin ${CUSTOM_CLONE_URL}
;;
"0")
# https://github.com/
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-github.com ${Font} \n ======== \n"
git remote set-url origin https://github.com/lkeme/BiliHelper-personal.git
;;
"1")
# https://ghproxy.com/
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
;;
"2")
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-github.com.cnpmjs.org ${Font} \n ======== \n"
git remote set-url origin https://github.com.cnpmjs.org/lkeme/BiliHelper-personal.git
# http://fastgit.org/
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"
Expand Down

0 comments on commit 75c62e7

Please sign in to comment.