部署文档与脚本增加 HTTP 代理配置(192.168.8.246:10810)。
This commit is contained in:
+20
-1
@@ -37,6 +37,8 @@
|
||||
|
||||
每次修改代码后,按改动范围在**开发机**操作,再推送到远端仓库,最后在服务器执行 `update.sh`。
|
||||
|
||||
> **服务器需代理时**:在 `update.sh` 前设置与 [§3 一键部署](#3-一键部署新服务器) 相同的 `export http_proxy=...` 命令。
|
||||
|
||||
### 流程总览
|
||||
|
||||
```
|
||||
@@ -105,6 +107,17 @@ bash /opt/secondary-school-grade-archive/deploy/update.sh
|
||||
|
||||
## 3. 一键部署(新服务器)
|
||||
|
||||
若服务器访问 Git / apt / PyPI 需走代理,**在 `bash deploy/install.sh` 之前**设置:
|
||||
|
||||
```bash
|
||||
export http_proxy=http://192.168.8.246:10810
|
||||
export https_proxy=http://192.168.8.246:10810
|
||||
export HTTP_PROXY="$http_proxy"
|
||||
export HTTPS_PROXY="$https_proxy"
|
||||
```
|
||||
|
||||
完整安装命令:
|
||||
|
||||
```bash
|
||||
git clone https://git.bz121.com/dekun/secondary-school-grade-archive.git /opt/secondary-school-grade-archive
|
||||
cd /opt/secondary-school-grade-archive
|
||||
@@ -112,6 +125,8 @@ chmod +x deploy/*.sh
|
||||
bash deploy/install.sh
|
||||
```
|
||||
|
||||
> 脚本会读取上述环境变量,并自动配置 `apt` 代理。`git pull`、`pip install` 同样生效。内网直连时可不设代理。
|
||||
|
||||
脚本自动完成:
|
||||
|
||||
1. 安装 PostgreSQL、Python 依赖
|
||||
@@ -152,7 +167,11 @@ systemctl status grade-archive
|
||||
# 实时日志
|
||||
journalctl -u grade-archive -f
|
||||
|
||||
# 拉代码并重启(日常更新)
|
||||
# 拉代码并重启(日常更新;需代理时先 export,见 §3)
|
||||
export http_proxy=http://192.168.8.246:10810
|
||||
export https_proxy=http://192.168.8.246:10810
|
||||
export HTTP_PROXY="$http_proxy"
|
||||
export HTTPS_PROXY="$https_proxy"
|
||||
bash /opt/secondary-school-grade-archive/deploy/update.sh
|
||||
|
||||
# 备份数据库与 uploads
|
||||
|
||||
Reference in New Issue
Block a user