Skip to content

Commit b8dad1d

Browse files
committed
docs: update air-gapped deployment document
Signed-off-by: Daniel Hu <[email protected]>
1 parent d28d88d commit b8dad1d

File tree

14 files changed

+171
-389
lines changed

14 files changed

+171
-389
lines changed

docs/best-practices/air-gapped-deployment.zh.md

Lines changed: 67 additions & 266 deletions
Large diffs are not rendered by default.

docs/best-practices/air-gapped-jenkins-pipeline.zh.md

Lines changed: 0 additions & 81 deletions
This file was deleted.

docs/best-practices/gitops.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Note: These dependencies are optional; you can use dependency to make sure a cer
3737
In your working directory, run:
3838

3939
```shell
40-
sh -c "$(curl -fsSL https://raw.githubusercontent.com/devstream-io/devstream/main/hack/install/download.sh)"
40+
sh -c "$(curl -fsSL https://download.devstream.io/download.sh)
4141
```
4242
4343
This will download the corresponding `dtm` binary to your working directory according to your OS and chip architecture, and grant the binary execution permission.

docs/best-practices/gitops.zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
进入你的工作目录,运行:
3030

3131
```shell
32-
sh -c "$(curl -fsSL https://raw.githubusercontent.com/devstream-io/devstream/main/hack/install/download.sh)"
32+
sh -c "$(curl -fsSL https://download.devstream.io/download.sh)
3333
```
3434
3535
这个命令会根据你的操作系统和芯片架构下载对应的 `dtm` 二进制文件到你的工作目录中,并赋予二进制文件执行权限。

docs/core-concepts/config.zh.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ DevStream使用YAML文件来描述你的DevOps工具链配置。
1010

1111
主配置包含三个部分:
1212

13-
- `varFile`: 指向定义变量的文件路径
14-
- `toolFile`: 指向定义插件的文件路径
15-
- `pluginDir`: 指向插件目录的路径,默认为 `~/.devstream/plugins`, 或使用 `-d` 参数指定一个目录
1613
- `state`: 指定DevStream状态存储位置
1714

1815
### 主配置文件示例

docs/install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
In your working directory, run:
1212

1313
```shell
14-
sh -c "$(curl -fsSL https://raw.githubusercontent.com/devstream-io/devstream/main/hack/install/download.sh)"
14+
sh -c "$(curl -fsSL https://download.devstream.io/download.sh)
1515
```
1616
1717
This will download the corresponding `dtm` binary to your working directory according to your OS and chip architecture, and grant the binary execution permission.

docs/install.zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
进入你的工作目录,运行:
1212

1313
```shell
14-
sh -c "$(curl -fsSL https://raw.githubusercontent.com/devstream-io/devstream/main/hack/install/download.sh)"
14+
sh -c "$(curl -fsSL https://download.devstream.io/download.sh)
1515
```
1616
1717
这个命令会根据你的操作系统和芯片架构下载对应的 `dtm` 二进制文件到你的工作目录中,并赋予二进制文件执行权限。

docs/plugins/helm-installer/helm-installer.zh.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,11 @@
77
只需要一个最小化配置,你就可以快速使用默认配置部署一个 Helm Chart。你可以将如下配置内容保存到本地 config.yaml 文件中:
88

99
```yaml
10-
---
11-
varFile: ""
12-
toolFile: ""
13-
state:
14-
backend: local
15-
options:
16-
stateFile: devstream.state
17-
18-
---
10+
config:
11+
state:
12+
backend: local
13+
options:
14+
stateFile: devstream.state
1915
tools:
2016
- name: helm-installer
2117
instanceID: argocd-001
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
##jenkins-images
2-
devstreamdev/jenkins:2.361.1-jdk11-dtm-0.1
2+
devstreamdev/jenkins:2.361.1-jdk11-dtm-0.2
33
kiwigrid/k8s-sidecar:1.15.0
44
jenkins/inbound-agent:4.11.2-4
55
maorfr/kube-tasks:0.2.0

docs/plugins/jenkins-pipeline.zh.md

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export GITLAB_SSHKEY=YOUR_REPO_PRIVATE_KEY
4545
!!! tip "提示"
4646

4747
如果是 GitHub,则这里的环境变量改成:
48-
48+
4949
```shell
5050
export IMAGE_REPO_PASSWORD=YOUR_IMAGE_REPO_PASSWORD
5151
export GITHUB_TOKEN=YOUR_GITHUB_TOKEN
@@ -196,3 +196,82 @@ tools:
196196
``` yaml
197197
--8<-- "jenkins-pipeline.yaml"
198198
```
199+
200+
201+
## 离线配置 (下文待进一步整理)
202+
203+
目前的 `jenkins-pipeline` 插件配置过程中会连接外部网络来安装插件和配置 `pipeline` 的共享库,为了支持在离线环境中使用 `jenkins-pipeline` 来创建和管理 `jenkins` 流水线,我们在 `jenkins-pipeline` 插件中提供了一个选项 `offline` 用于表示需要在离线环境下配置 `jenkins-pipeline`。
204+
205+
### Jenkins 插件
206+
207+
流水线正常运行需要依赖 `jenkins` 的几个插件。在离线环境中因为无法下载外部环境的插件,需要在 `jenkins` 预先安装好插件或者使用已经有插件的 `jenkins` 镜像,devstream 官方也提供了已预先安装好所有依赖的镜像 `devstreamdev/jenkins:2.361.1-jdk11-dtm-0.2`。
208+
209+
依赖的插件如下:
210+
| 插件名 | 作用 | 备注 |
211+
|--------------|----------------|----------------------------|
212+
| dingding-notifications | 用于发送钉钉通知 | 如果需要使用钉钉通知,则需要安装此插件 |
213+
| github-branch-source | jenkins github 插件 | 如果代码仓库使用的是 github,则必须安装此插件 |
214+
| gitlab-plugin | jenkins gitlab 插件 | 如果代码仓库使用的是 gitlab,则必须安装此插件 |
215+
| sonar | sonar sanner 代码扫描插件 | 如果需要使用 sonarqube,则需要安装此插件 |
216+
| kubernetes | jenkins kubernetes 插件 | 用于 jenkins runner, 必须安装此插件 |
217+
| git | jenkins git 插件 | 用于代码的克隆和权限认证, 必须安装此插件 |
218+
| configuration-as-code | jenkins 配置即代码插件 | 用于 devstream 配置 jenkins 的全局配置, 必须安装此插件|
219+
220+
### 共享库
221+
222+
在 `jenkins` 中 devstream 默认使用共享库来管理 jenkins 流水线的共用代码,在离线环境中因为无法连接共享库,所以 devstream 提供了单独的 `Jenkinfile` 配置。
223+
224+
225+
### app 示例配置
226+
227+
```yaml
228+
apps:
229+
- name: test
230+
spec:
231+
language: java
232+
framework: springboot
233+
repo:
234+
url: gitlab.com/root/test.git
235+
branch: main
236+
repoTemplate:
237+
url: https://github.com/devstream-io/dtm-repo-scaffolding-java-springboot.git
238+
ci:
239+
- type: template
240+
templateName: ci-pipeline
241+
242+
pipelineTemplates:
243+
- name: ci-pipeline
244+
type: jenkins-pipeline
245+
options:
246+
branch: main
247+
jenkins:
248+
url: jenkins.com
249+
user: admin
250+
offline: true # 在此处设置 offline 为 true, 即开启该 jenkins-pipeline 的离线模式
251+
imageRepo:
252+
user: repoUser
253+
```
254+
255+
使用该配置可得到以下输出:
256+
257+
```text
258+
2022-12-02 19:51:52 ℹ [INFO] Apply started.
259+
2022-12-02 19:51:52 ℹ [INFO] Using local backend. State file: devstream-app.state.
260+
2022-12-02 19:51:52 ℹ [INFO] Tool (repo-scaffolding/test) found in config but doesn't exist in the state, will be created.
261+
2022-12-02 19:51:52 ℹ [INFO] Tool (jenkins-pipeline/test) found in config but doesn't exist in the state, will be created.
262+
2022-12-02 19:51:52 ℹ [INFO] Start executing the plan.
263+
2022-12-02 19:51:52 ℹ [INFO] Changes count: 2.
264+
2022-12-02 19:51:52 ℹ [INFO] -------------------- [ Processing progress: 1/2. ] --------------------
265+
2022-12-02 19:51:52 ℹ [INFO] Processing: (repo-scaffolding/test) -> Create ...
266+
2022-12-02 19:51:52 ℹ [INFO] github start to download repoTemplate...
267+
2022-12-02 19:51:57 ✔ [SUCCESS] Tool (repo-scaffolding/test) Create done.
268+
2022-12-02 19:51:57 ℹ [INFO] -------------------- [ Processing progress: 2/2. ] --------------------
269+
2022-12-02 19:51:57 ℹ [INFO] Processing: (jenkins-pipeline/test) -> Create ...
270+
2022-12-02 19:51:58 ℹ [INFO] jenkins plugin imageRepo start config...
271+
2022-12-02 19:51:58 ⚠ [WARN] jenkins gitlab ssh key not config, private repo can't be clone
272+
2022-12-02 19:52:00 ℹ [INFO] jenkins start config casc...
273+
2022-12-02 19:52:07 ✔ [SUCCESS] Tool (jenkins-pipeline/test) Create done.
274+
2022-12-02 19:52:07 ℹ [INFO] -------------------- [ Processing done. ] --------------------
275+
2022-12-02 19:52:07 ✔ [SUCCESS] All plugins applied successfully.
276+
2022-12-02 19:52:07 ✔ [SUCCESS] Apply finished.
277+
```

0 commit comments

Comments
 (0)