Fix and update

This commit is contained in:
baohua
2026-02-09 11:34:35 -08:00
parent e669ee0fe8
commit 63377d0431
136 changed files with 2146 additions and 262 deletions

View File

@@ -1,4 +1,4 @@
## Drone
# Drone
基于 `Docker` `CI/CD` 工具 `Drone` 所有编译测试的流程都在 `Docker` 容器中进行
@@ -6,13 +6,13 @@
本小节以 `GitHub` + `Drone` 来演示 `Drone` 的工作流程当然在实际开发过程中你的代码也许不在 GitHub 托管那么你可以尝试使用 `Gogs` + `Drone` 来进行 `CI/CD`
### Drone 关联项目
## Drone 关联项目
Github 新建一个名为 `drone-demo` 的仓库
打开我们已经 [部署好的 Drone 网站](9.2_install.md) 或者 [Drone Cloud](https://cloud.drone.io),使用 GitHub 账号登录,在界面中关联刚刚新建的 `drone-demo` 仓库。
### 编写项目源代码
## 编写项目源代码
初始化一个 git 仓库
@@ -72,7 +72,9 @@ trigger:
└── app.go
```
### 推送项目源代码到 GitHub
## 推送项目源代码到 GitHub
运行以下命令
```bash
$ git add .
@@ -82,7 +84,7 @@ $ git commit -m "test drone ci"
$ git push origin master
```
### 查看项目构建过程及结果
## 查看项目构建过程及结果
打开我们部署好的 `Drone` 网站或者 Drone Cloud即可看到构建结果
@@ -92,7 +94,7 @@ $ git push origin master
本书 GitBook 也使用 Drone 进行 CI/CD具体配置信息请查看本书根目录 [`.drone.yml`](../../../.drone.yml) 文件
### 参考链接
## 参考链接
* [Drone Github](https://github.com/drone/drone)
* [Drone 文档](https://docs.drone.io/)

View File

@@ -69,18 +69,23 @@ volumes:
```bash
## 必填 服务器地址,例如 drone.domain.com
DRONE_SERVER_HOST=
DRONE_SERVER_PROTO=https
DRONE_RPC_SECRET=secret
HOSTNAME=demo
## 必填 在 GitHub 应用页面查看
DRONE_GITHUB_CLIENT_ID=
## 必填 在 GitHub 应用页面查看
DRONE_GITHUB_CLIENT_SECRET=
```
#### 启动 Drone
运行以下命令
```bash
$ docker-compose up -d
```