doc: update CONTRIBUTING.md #535

This commit is contained in:
jaywcjlove 2024-02-29 01:04:10 +08:00
parent 8c21b7126a
commit 11dc28cea3

View File

@ -98,15 +98,15 @@ $ npm run start # 监听 md 文件编译输出 HTML
$ git clone https://github.com/jaywcjlove/reference.git -b gh-pages
```
**进击方式:**
**定时更新**
Linux服务执行 ` git-down-pages.sh` [会根据线上pages的commit 和 本地 commit 比较。如果不一致才会同步更新,否则跳过]
Linux 服务执行创建 `git-down-pages.sh` 脚本,将脚本放置在 `/opt/cron/` 目录下
注意:请把脚本放在/opt/cron/ 目录下
> 注意:⚠️ 脚本会根据线上 pages 的 commit 和 本地 commit 比较。如果不一致才会同步更新,否则跳过
下面是脚本 `git-down-pages.sh` 的源码
```bash
vim git-down-pages.sh
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
@ -161,8 +161,6 @@ if [ ! -d "$DATA_DIR" ]; then
fi
fi
# 进入 /data 目录
cd $DATA_DIR
@ -192,29 +190,27 @@ echo "--------------------------------------------------------------------------
endDate=`date +"%Y-%m-%d %H:%M:%S"`
echo "★[$endDate] Successful"
echo "----------------------------------------------------------------------------"
```
```bash
定时任务
注意:请把脚本放在/opt/cron/ 目录下 (时间可以根据自己需求设定)
下面案例每十分钟同步线上的pages的内容
crontab -e
*/10 * * * * /opt/cron/git-down-pages.sh >> /opt/cron/git-down.log 2>&1
NGINX 配置:
listen 80;
listen 443 ssl http2;
server_name xxx.xxx.top; #配置你的域名
index index.php index.html index.htm default.php default.htm default.html;
root /data/reference; # 文件存放的位置
**创建定时任务**
注意:请把脚本放在 `/opt/cron/` 目录下 (时间可以根据自己需求设定),下面案例:每十分钟同步线上的 `pages` 的内容
```shell
crontab -e
*/10 * * * * /opt/cron/git-down-pages.sh >> /opt/cron/git-down.log 2>&1
```
**添加 NGINX 配置:**
```nginx
listen 80;
listen 443 ssl http2;
server_name xxx.xxx.top; #配置你的域名
index index.php index.html index.htm default.php default.htm default.html;
root /data/reference; # 文件存放的位置
```
### 方法二,使用 [docker](https://hub.docker.com/r/wcjiang/reference) 快捷部署 web 版