Skip to content

Commit 4efa862

Browse files
authored
Merge pull request #1415 from merico-dev/docs-ht
Docs: update installation related documents
2 parents 6ce958f + 35380d9 commit 4efa862

8 files changed

+95
-124
lines changed

docs/install.md

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Installation
22

3-
## 0 Currently supported operating systems and chip architectures
3+
!!! note
4+
Currently supported operating systems and chip architectures:
45

5-
* Darwin/arm64
6-
* Darwin/amd64
7-
* Linux/amd64
6+
1. Darwin/arm64
7+
2. Darwin/amd64
8+
3. Linux/amd64
89

910
## 1 Install dtm binary with script
1011

@@ -16,26 +17,21 @@ sh -c "$(curl -fsSL https://download.devstream.io/download.sh)"
1617

1718
This will download the corresponding `dtm` binary to your working directory according to your OS and chip architecture, and grant the binary execution permission.
1819

19-
> Optional: you can then move `dtm` to a place which is in your PATH. For example: `mv dtm /usr/local/bin/`.
20+
!!! note "Optional"
2021

21-
## 2 Install dtm with [asdf](https://asdf-vm.com/)
22+
Move `dtm` to a place which is in your PATH. For example: `mv dtm /usr/local/bin/`.
23+
24+
## 2 Download manually from the GitHub Release page
25+
26+
You could find the latest version of `dtm` on the [Release](https://github.com/devstream-io/devstream/releases/) page and click Download.
27+
28+
If your browser isn't working properly, "curl" is also a good option:
2229

2330
```shell
24-
# Plugin
25-
asdf plugin add dtm
26-
# Show all installable versions
27-
asdf list-all dtm
28-
# Install specific version
29-
asdf install dtm latest
30-
# Set a version globally (on your ~/.tool-versions file)
31-
asdf global dtm latest
32-
# Now dtm commands are available
33-
dtm help
31+
# Version v0.10.3, OS type linux and CPU arch amd64 need to be modified as needed
32+
$ curl -o dtm https://download.devstream.io/v0.10.3/dtm-linux-amd64
3433
```
3534

36-
## 3 Download manually from the GitHub Release page
37-
38-
You could find the latest version of `dtm` on the [Release](https://github.com/devstream-io/devstream/releases/) page and click Download.
3935
Note that there are multiple versions of `dtm` available, so you will need to choose the correct version for your operating system and chip architecture. Once downloaded locally, you can choose to rename it, move it to the directory containing `$PATH` and give it executable permissions, for example, on Linux you can do this by running the following command.
4036

4137
```shell
@@ -47,5 +43,20 @@ Then you can verify that the permissions and version of dtm are correct with the
4743

4844
```shell
4945
$ dtm version
50-
0.10.0
46+
0.10.3
47+
```
48+
49+
## 3 Install dtm with [asdf](https://asdf-vm.com/)
50+
51+
```shell
52+
# Plugin
53+
asdf plugin add dtm
54+
# Show all installable versions
55+
asdf list-all dtm
56+
# Install specific version
57+
asdf install dtm latest
58+
# Set a version globally (on your ~/.tool-versions file)
59+
asdf global dtm latest
60+
# Now dtm commands are available
61+
dtm help
5162
```

docs/install.zh.md

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# 安装
22

3-
## 0 当前支持的操作系统与芯片架构
3+
!!! note "提示"
4+
当前 dtm 发行版支持如下操作系统与 CPU 架构组合:
45

5-
* Darwin/arm64
6-
* Darwin/amd64
7-
* Linux/amd64
6+
1. Darwin/arm64
7+
2. Darwin/amd64
8+
3. Linux/amd64
89

910
## 1 用脚本安装
1011

@@ -16,26 +17,21 @@ sh -c "$(curl -fsSL https://download.devstream.io/download.sh)"
1617

1718
这个命令会根据你的操作系统和芯片架构下载对应的 `dtm` 二进制文件到你的工作目录中,并赋予二进制文件执行权限。
1819

19-
> 可选:建议你将 dtm 移动到包含于 PATH 的目录下,比如 `mv dtm /usr/local/bin/`
20+
!!! note "可选"
2021

21-
## 2 用 [asdf](https://asdf-vm.com/) 安装
22+
将 dtm 移动到包含于 PATH 的目录下,比如 `mv dtm /usr/local/bin/`。
23+
24+
## 2 从 GitHub Release 页面手动下载安装
25+
26+
[Release](https://github.com/devstream-io/devstream/releases/) 页面找到当前最新版本 `dtm`,然后点击下载。
27+
28+
如果你不方便使用浏览器下载,也可以选择使用 curl:
2229

2330
```shell
24-
# 安装 dtm 插件
25-
asdf plugin add dtm
26-
# 列出所有可用版本
27-
asdf list-all dtm
28-
# 安装特定版本
29-
asdf install dtm latest
30-
# 设置全局版本 (在 ~/.tool-versions 文件中)
31-
asdf global dtm latest
32-
# 现在你就能使用 dtm 了
33-
dtm help
31+
# 版本号 v0.10.3,系统类型 linux 和 CPU 架构 amd64 根据需要灵活修改
32+
$ curl -o dtm https://download.devstream.io/v0.10.3/dtm-linux-amd64
3433
```
3534

36-
## 3 从 GitHub Release 页面手动下载
37-
38-
[Release](https://github.com/devstream-io/devstream/releases/) 页面找到当前最新版本 `dtm`,然后点击下载。
3935
需要注意的是当前 `dtm` 提供了多个版本,你需要根据操作系统和芯片架构选择自己需要的正确版本。下载到本地后,你可以选择将其重命名,移入包含在"$PATH"的目录里并赋予其可执行权限,比如在 Linux 上你可以执行如下命令完成这些操作:
4036

4137
```shell
@@ -47,5 +43,20 @@ chmod +x dtm
4743

4844
```shell
4945
$ dtm version
50-
0.10.0
46+
0.10.3
47+
```
48+
49+
## 3 用 [asdf](https://asdf-vm.com/) 安装
50+
51+
```shell
52+
# 安装 dtm 插件
53+
asdf plugin add dtm
54+
# 列出所有可用版本
55+
asdf list-all dtm
56+
# 安装特定版本
57+
asdf install dtm latest
58+
# 设置全局版本 (在 ~/.tool-versions 文件中)
59+
asdf global dtm latest
60+
# 现在你就能使用 dtm 了
61+
dtm help
5162
```

docs/use-cases/gitlab-jenkins-harbor/2-gitlab-jenkins-harbor.zh.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88

99
本文基于 kubeadm 部署的单节点 k8s 环境,不适用于 minikube 和 kind 等 docker-in-docker 类型的 k8s 集群。
1010

11-
## 2、准备配置文件
11+
## 2、安装 dtm
12+
13+
你可以参考[这个文档](../../install.zh.md)完成 dtm 的下载与安装。
14+
15+
## 3、准备配置文件
1216

1317
DevStream 可以简单地以 **local** 作为[状态](../../core-concepts/state.zh.md) Backend,也就是将状态保存到本地文件。如果你在本地测试,可以选择使用这种方式;
1418
而企业 On premise 环境部署可能需要使用 **k8s** Backend 将状态通过 `kube-apiserver` 存入 etcd,两种方式配置分别如下:
@@ -144,7 +148,7 @@ tools:
144148
size: 1Gi
145149
```
146150
147-
## 3、初始化
151+
## 4、初始化
148152
149153
你可以将上面这个配置文件(config-tools.yaml)放到服务器上任意一个合适的目录,比如 `~/devstream-test/`,然后在该目录下执行:
150154

@@ -154,7 +158,7 @@ dtm init -f config-tools.yaml
154158

155159
这个命令会帮助你下载所有需要的 DevStream 插件。
156160

157-
## 4、开始部署
161+
## 5、开始部署
158162

159163
接着你就可以执行 apply 命令了:
160164

@@ -214,11 +218,11 @@ Stdout: 34cdd2a834a1c21be192064eacf1e29536ff45c52562956b97d6d376a5dae11b
214218

215219
从日志里你可以看到,这时候 GitLab、Jenkins 和 Harbor 就已经部署完成了。
216220

217-
## 5、验证部署结果
221+
## 6、验证部署结果
218222

219223
你可以通过如下方式验证 GitLab + Jenkins + Harbor 三个工具的部署结果。
220224

221-
### 5.1、DNS 配置
225+
### 6.1、DNS 配置
222226

223227
前面你给 GitLab + Jenkins + Harbor 三个工具的配置文件里都设置了域名,然后你可以直接将这些域名与 IP 的映射关系配置到 DNS 服务器里。
224228

@@ -250,7 +254,7 @@ echo "44.33.22.11 jenkins.example.com" >> /etc/hosts
250254
exit
251255
```
252256

253-
### 5.2、访问 GitLab
257+
### 6.2、访问 GitLab
254258

255259
你可以在自己的 PC 里配置 `44.33.22.11 gitlab.example.com` 静态域名解析记录,然后在浏览器里通过 `http://gitlab.example.com:30080` 访问到 GitLab:
256260

@@ -268,7 +272,7 @@ gitlab-rake "gitlab:password:reset" # 执行后按照提示输入用户名 root
268272

269273
拿到 root 密码后,你可以尝试用 root/YOUR_PASSWORD 来登录 GitLab。
270274

271-
### 5.3、访问 Jenkins
275+
### 6.3、访问 Jenkins
272276

273277
前面你可能已经通过 `curl http://jenkins.example.com` 在主机内验证了 Jenkins 的网络连通性,想要远程通过域名访问 Jenkins,你还需要在自己的 PC 里配置 `44.33.22.11 jenkins.example.com` 静态域名解析记录。
274278

@@ -286,7 +290,7 @@ Jenkins 的 admin 用户初始登录密码是 `changeme`,如果你仔细看了
286290
<figcaption>Jenkins dashboard</figcaption>
287291
</figure>
288292

289-
### 5.4、访问 Harbor
293+
### 6.4、访问 Harbor
290294

291295
前面你可能也已经通过 `curl http://harbor.example.com` 在主机内验证了 Harbor 的网络连通性,同样你可以通过 `docker login harbor.example.com:80` 命令来尝试登录 Harbor。
292296

@@ -306,7 +310,7 @@ Harbor 的 admin 用户初始登录密码是 `Harbor12345`,你可以尝试用
306310
<figcaption>Harbor dashboard</figcaption>
307311
</figure>
308312

309-
## 6、环境清理
313+
## 7、环境清理
310314

311315
你可以通过如下命令清理环境:
312316

docs/use-cases/gitlab-jenkins-harbor/3-gitlab-jenkins-harbor-air-gapped.zh.md

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -17,39 +17,9 @@
1717

1818
### 1.1、下载 dtm
1919

20-
如果你的 PC 和服务器操作系统以及 CPU 架构一致,比如都是 Linux/amd64,那么你可以直接在 PC 上运行如下命令完成 dtm 的下载:
20+
你可以参考[这个文档](../../install.zh.md)下载 dtm
2121

22-
```shell
23-
sh -c "$(curl -fsSL https://download.devstream.io/download.sh)"
24-
```
25-
26-
如果使用的 shell 不是 bash,可能会执行上述命令失败,这时候你也可以选择直接用 curl 下载 dtm。这时候你需要先访问 DevStream 的 [Release](https://github.com/devstream-io/devstream/releases/) 页面找到当前最新版本 `dtm`,然后找到和你的服务器匹配的版本。当前 `dtm` 提供了多个版本,分别是:
27-
28-
1. Darwin/arm64
29-
2. Darwin/amd64
30-
3. Linux/amd64
31-
32-
这时候,相信你可以很容易拼接出类似下面这个命令:
33-
34-
```shell
35-
curl -o dtm https://download.devstream.io/v0.10.3/dtm-linux-amd64
36-
```
37-
38-
注意:这里的版本、系统类型、CPU 架构等信息需要灵活调整。
39-
40-
等 dtm 下载到你的 PC 后,你需要通过内网将其传输到某一台内部服务器上,移入包含在"$PATH"的目录里并赋予其可执行权限,比如在 Linux 上你可以执行如下命令完成这些操作:
41-
42-
```shell
43-
chmod +x dtm
44-
mv dtm /usr/local/bin/
45-
```
46-
47-
然后在服务器上你可以通过如下命令验证 dtm 的权限以及版本等是否正确:
48-
49-
```shell
50-
$ dtm version
51-
0.10.3
52-
```
22+
唯一需要注意的是,下载完之后,请记得将 dtm 传输到你需要使用它的机器上。
5323

5424
### 1.2、下载 plugins
5525

docs/use-cases/gitlab-jenkins-harbor/5-java-springboot-pipeline-with-gitlab-jenkins-harbor.zh.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@
1919
2. DevStream 根据你给定配置,使用 CI 模板创建 CI 流程,过程中会涉及到 CI 工具的配置(比如调用 Jenkins API 完成一些 Jenkins 插件的安装等);
2020
3. 最终 DevStream 完成全部配置后,如果你提交代码到 DevStream 为你创建的代码库中,GitLab 便会出发 Jenkins 执行相应的 CI 流程,Jenkins 上的流水线运行结果也会实时回显到 GitLab 上,并且这个过程中构建出来的容器镜像会被自动推送到 Harbor 上。
2121

22-
## 2、准备配置文件
22+
## 2、安装 dtm
23+
24+
你可以参考[这个文档](../../install.zh.md)完成 dtm 的下载与安装。
25+
26+
## 3、准备配置文件
2327

2428
DevStream 可以简单地以 **local** 作为[状态](../../core-concepts/state.zh.md) Backend,也就是将状态保存到本地文件。如果你在本地测试,可以选择使用这种方式;
2529
而企业 On premise 环境部署可能需要使用 **k8s** Backend 将状态通过 `kube-apiserver` 存入 etcd,两种方式配置分别如下:
@@ -109,11 +113,11 @@ pipelineTemplates:
109113
110114
你可以将这个配置文件放到服务器上的某一个路径内,比如 `~/devstream-test/config-apps.yaml`。
111115

112-
## 3、让配置生效
116+
## 4、让配置生效
113117

114118
你还需要几个简单的步骤来让上述配置生效。
115119

116-
### 3.1、准备 GitLab Token
120+
### 4.1、准备 GitLab Token
117121

118122
你可以参考下图方式在 GitLab 上创建一个 token,这个 token 将给 DevStream 必要的权限用来在 GitLab 上创建项目脚手架等:
119123

@@ -142,7 +146,7 @@ export JENKINS_PASSWORD=changeme
142146

143147
你可以将这个配置文件放到服务器上同一个目录,比如 `~/devstream-test/`,然后在该目录下执行:
144148

145-
### 3.2、开始执行
149+
### 4.2、开始执行
146150

147151
首先你需要执行初始化命令:
148152

@@ -201,7 +205,7 @@ root@dtm-realk8sdev:~# ./dtm apply -y -f config-apps.yaml
201205
2022-12-02 01:04:59 ✔ [SUCCESS] Apply finished.
202206
```
203207

204-
## 4、查看执行结果
208+
## 5、查看执行结果
205209

206210
这时候你可以在 GitLab 上看到 dtm 为你准备的 Java Spring Boot 项目脚手架:
207211

@@ -233,7 +237,7 @@ root@dtm-realk8sdev:~# ./dtm apply -y -f config-apps.yaml
233237
<figcaption>Image in Harbor</figcaption>
234238
</figure>
235239

236-
## 5、环境清理
240+
## 6、环境清理
237241

238242
你可以通过如下命令清理环境:
239243

docs/use-cases/gitlab-jenkins-harbor/6-gitlab-jenkins-harbor-java-springboot.zh.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@
4040

4141
这个图中的 GitLab 和 GitHub 可以随意互换,它们只是被当做保存项目脚手架模板库存放地址和脚手架模板渲染后的最终项目存放地址,DevStream 对 GitHub 和 GitLab 都支持。换言之,如果你将模板保存到 GitLab,最终项目也托管在 GitLab,便可以完全不依赖 GitHub 而使用 DevStream。
4242

43-
### 1.2、相关插件概览
43+
### 1.2 安装 dtm
44+
45+
你可以参考[这个文档](../../install.zh.md)完成 dtm 的下载与安装。
46+
47+
### 1.3、相关插件概览
4448

4549
当前工具链主要涉及如下 DevStream 插件:
4650

@@ -56,7 +60,7 @@
5660
1. 上述插件不是必选集,你可以根据实际情况灵活调整。比如你本地已经有 GitLab 环境了,那么你可以果断忽略 `gitlab-ce-docker` 插件。
5761
2. 你不再需要关心 repo-scaffolding 和 jenkins-pipeline 这类“非工具部署”相关插件的配置,你只要定义好自己的“app”,剩下的工作 DevStream 会帮你完成。至于 app 如何定义,下文会详细介绍。
5862

59-
### 1.3、部署流程介绍
63+
### 1.4、部署流程介绍
6064

6165
你将分2步来完成这条工具链的搭建过程。
6266

docs/use-cases/gitlab-jenkins-harbor/7-java-springboot-pipeline-with-gitlab-jenkins-harbor-air-gapped.zh.md

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,39 +19,9 @@
1919

2020
### 1.1、下载 dtm
2121

22-
如果你的 PC 和服务器操作系统以及 CPU 架构一致,比如都是 Linux/amd64,那么你可以直接在 PC 上运行如下命令完成 dtm 的下载:
22+
你可以参考[这个文档](../../install.zh.md)下载 dtm
2323

24-
```shell
25-
sh -c "$(curl -fsSL https://download.devstream.io/download.sh)"
26-
```
27-
28-
如果使用的 shell 不是 bash,可能会执行上述命令失败,这时候你也可以选择直接用 curl 下载 dtm。这时候你需要先访问 DevStream 的 [Release](https://github.com/devstream-io/devstream/releases/) 页面找到当前最新版本 `dtm`,然后找到和你的服务器匹配的版本。当前 `dtm` 提供了多个版本,分别是:
29-
30-
1. Darwin/arm64
31-
2. Darwin/amd64
32-
3. Linux/amd64
33-
34-
这时候,相信你可以很容易拼接出类似下面这个命令:
35-
36-
```shell
37-
curl -o dtm https://download.devstream.io/v0.10.2/dtm-linux-amd64
38-
```
39-
40-
注意:这里的版本、系统类型、CPU 架构等信息需要灵活调整。
41-
42-
等 dtm 下载到你的 PC 后,你需要通过内网将其传输到某一台内部服务器上,移入包含在"$PATH"的目录里并赋予其可执行权限,比如在 Linux 上你可以执行如下命令完成这些操作:
43-
44-
```shell
45-
chmod +x dtm
46-
mv dtm /usr/local/bin/
47-
```
48-
49-
然后在服务器上你可以通过如下命令验证 dtm 的权限以及版本等是否正确:
50-
51-
```shell
52-
$ dtm version
53-
0.10.2
54-
```
24+
唯一需要注意的是,下载完之后,请记得将 dtm 传输到你需要使用它的机器上。
5525

5626
### 1.2、下载 plugins
5727

docs/use-cases/gitops-python-flask/4-gitlab-dtm-apps.zh.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,3 @@ cd ../
310310
rm -rf test/
311311
rm -rf ~/.devstream/
312312
```
313-
314-
315-

0 commit comments

Comments
 (0)