添加配置
This commit is contained in:
37
README.md
37
README.md
@@ -24,6 +24,7 @@
|
||||
|
||||
```
|
||||
deploy-test/
|
||||
├── 00-init-tools.sh # 步骤0(可选):Linux 服务器安装 Go / Node / Docker、GOPROXY、GitHub HTTPS 重写
|
||||
├── common.sh # 公共函数库(路径、日志函数)
|
||||
├── 01-init-env.sh # 步骤1:生成 .env.deploy-test 配置模板
|
||||
├── 02-patch-config.sh # 步骤2:将 .env.deploy-test 写入各服务 YAML
|
||||
@@ -57,18 +58,50 @@ deploy-test/
|
||||
|
||||
---
|
||||
|
||||
## 步骤 0:`00-init-tools.sh`(裸机 / 新服务器)
|
||||
|
||||
在**尚未安装 Go、Node、Docker** 的 Linux 测试服务器上,先执行本脚本再跑 `01-init-env.sh` 及后续步骤。`setup.sh` **不会**自动调用它,需手动执行。
|
||||
|
||||
| 项目 | 说明 |
|
||||
|------|------|
|
||||
| **作用** | 安装 Go(默认 1.22.5,可用 `GO_VERSION` 覆盖)、配置 GOPROXY(测速选节点)、安装 Node.js LTS、全局安装 pnpm/yarn、安装 Docker、将 GitHub SSH 克隆地址重写为 HTTPS(避免 `pc` 等项目 `yarn install` 因无 SSH 密钥失败) |
|
||||
| **环境变量** | `GO_VERSION`(如 `1.22.5`)、`GO_ARCH`(`amd64` / `arm64`)、`NODE_VERSION`(Node 大版本,默认 `20`) |
|
||||
| **权限** | 需要 **root** 或 **sudo**(写入 `/usr/local/go`、`/etc/profile.d/deploy-env.sh` 等) |
|
||||
| **系统** | 面向 Ubuntu/Debian(`apt-get`);脚本内注释说明前置条件 |
|
||||
|
||||
```bash
|
||||
# 安装全部(Go + GOPROXY + Node + Docker)
|
||||
sudo ./deploy-test/00-init-tools.sh
|
||||
|
||||
# 或只执行其中一项
|
||||
sudo ./deploy-test/00-init-tools.sh go # Go + GOPROXY
|
||||
sudo ./deploy-test/00-init-tools.sh goproxy # 仅重配 GOPROXY
|
||||
sudo ./deploy-test/00-init-tools.sh node # 仅 Node / npm / pnpm / yarn
|
||||
sudo ./deploy-test/00-init-tools.sh docker # 仅 Docker
|
||||
```
|
||||
|
||||
执行结束后脚本会提示:新开终端需 `source /etc/profile.d/deploy-env.sh` 或重新登录 SSH,再执行 `./deploy-test/01-init-env.sh`。
|
||||
|
||||
---
|
||||
|
||||
## 快速开始
|
||||
|
||||
### 首次使用
|
||||
|
||||
```bash
|
||||
# 一键执行(推荐)
|
||||
# 裸机请先装工具(可选,见上文「步骤 0」)
|
||||
# sudo ./deploy-test/00-init-tools.sh
|
||||
|
||||
# 一键执行(推荐,不含 00-init-tools)
|
||||
./deploy-test/setup.sh
|
||||
```
|
||||
|
||||
### 分步执行
|
||||
|
||||
```bash
|
||||
# 0. (可选)裸机安装 Go / Node / Docker,见上文「步骤 0」
|
||||
# sudo ./deploy-test/00-init-tools.sh
|
||||
|
||||
# 1. 生成配置模板
|
||||
./deploy-test/01-init-env.sh
|
||||
|
||||
@@ -94,7 +127,7 @@ vim .env.deploy-test
|
||||
./deploy-test/07-start-frontend.sh
|
||||
```
|
||||
|
||||
> **pc(Electron)依赖安装**:首次在**无 GitHub SSH 密钥**的服务器上部署时,请先执行 `./deploy-test/00-init-tools.sh`(会配置将 GitHub SSH 地址重写为 HTTPS),或见下文「pc 前端 yarn install 失败」。`pc` 目录统一使用 **Yarn**;若存在 `package-lock.json` 会触发 Yarn 混用警告,可删除该文件后仅保留 `yarn.lock`。
|
||||
> **pc(Electron)依赖安装**:在跑 `06-install-frontend.sh` 前,裸机请先执行 **`00-init-tools.sh`**(见上文「步骤 0」,含 GitHub SSH→HTTPS 重写)。仍报错见下文「pc 前端 yarn install 失败」。`pc` 建议仅用 **Yarn**;可删除 `package-lock.json` 消除混用锁文件警告。
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user