windows support

This commit is contained in:
BennyThink
2021-06-30 23:44:14 +08:00
parent a1d64ccca7
commit 6ada39e9b6
2 changed files with 22 additions and 7 deletions

View File

@@ -3,9 +3,17 @@
# 网站部署方式
## 一键脚本
**仅支持AMD64请先安装 docker、docker-compose和curl**
* Linux/macOS
`bash -c "$(curl -fsSL https://raw.githubusercontent.com/tgbot-collection/YYeTsBot/master/scripts/install.sh)"`
* Windows
### Linux/macOS
```bash
bash -c "$(curl -fsSL https://raw.githubusercontent.com/tgbot-collection/YYeTsBot/master/scripts/install.sh)"
````
### Windows
请再安装一个 [git for windows](https://gitforwindows.org/),然后桌面空白处右键,选择 `git bash here`
再然后
```bash
bash -c "$(curl -fsSL https://raw.githubusercontent.com/tgbot-collection/YYeTsBot/master/scripts/install.sh)"
````
## docker-compose
参考 `yyetsweb`目录下的 `README`

View File

@@ -1,5 +1,4 @@
#!/bin/bash
set -e
function splash() {
echo "本脚本会在 ${HOME}/YYeTs 部署人人影视web"
@@ -35,11 +34,19 @@ function import_db() {
echo "[4/5] 正在下载并导入数据库"
curl -o /tmp/yyets_mongo.gz https://yyets.dmesg.app/data/yyets_mongo.gz
docker cp /tmp/yyets_mongo.gz yyets_mongo_1:/tmp
docker-compose exec mongo mongorestore --gzip --archive=/tmp/yyets_mongo.gz
# special for windows
result=$(uname -a | grep "Msys")
if [[ "$result" != "" ]]; then
echo "docker exec yyets_mongo_1 mongorestore --gzip --archive=/tmp/yyets_mongo.gz" >windows.bat
echo "docker exec yyets_mongo_1 rm /tmp/yyets_mongo.gz" >>windows.bat
cmd "/C windows.bat"
rm windows.bat
else
docker exec yyets_mongo_1 mongorestore --gzip --archive=/tmp/yyets_mongo.gz
docker exec yyets_mongo_1 rm /tmp/yyets_mongo.gz
fi
docker-compose exec mongo rm /tmp/yyets_mongo.gz
rm /tmp/yyets_mongo.gz
}