Skip to content

Commit ec18070

Browse files
committed
docs: update docs of config files
Signed-off-by: Bird <[email protected]>
1 parent 6459e49 commit ec18070

File tree

7 files changed

+26
-20
lines changed

7 files changed

+26
-20
lines changed

docs/best-practices/gitops.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export DOCKERHUB_TOKEN="YOUR_DOCKERHUB_TOKEN_HERE"
211211
Run:
212212
213213
```bash
214-
./dtm init
214+
./dtm init -f config.yaml
215215
```
216216
217217
This downloads the required plugins, according to the config file, automatically.
@@ -233,7 +233,7 @@ You'll get some outputs similar to the following:
233233
Run:
234234
235235
```bash
236-
./dtm apply -y
236+
./dtm apply -f config.yaml -y
237237
```
238238
239239
You will see similar outputs as the following:
@@ -332,7 +332,7 @@ And accesses `localhost:8080` in your browser, you can see the deployed app retu
332332
Run:
333333
334334
```bash
335-
./dtm delete -y
335+
./dtm delete -f config.yaml -y
336336
```
337337
338338
And you will get similar outputs to the following:

docs/best-practices/gitops.zh.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ export DOCKERHUB_TOKEN="YOUR_DOCKERHUB_TOKEN_HERE"
210210
运行以下命令,以根据配置文件自动下载所需插件:
211211
212212
```bash
213-
./dtm init
213+
./dtm init -f config.yaml
214214
```
215215
216216
你会看到类似下面的输出:
@@ -230,7 +230,7 @@ export DOCKERHUB_TOKEN="YOUR_DOCKERHUB_TOKEN_HERE"
230230
运行:
231231
232232
```bash
233-
./dtm apply -y
233+
./dtm apply -f config.yaml -y
234234
```
235235
236236
你会看到类似下面的输出:
@@ -329,7 +329,7 @@ kubectl port-forward -n default svc/helloworld 8080:80
329329
运行:
330330
331331
```bash
332-
./dtm delete -y
332+
./dtm delete -f config.yaml -y
333333
```
334334
335335
你会看到如下的输出:

docs/commands/init.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@ When running `dtm init`, it will download plugins from the AWS S3 bucket(through
66

77
There are two ways to download plugins:
88

9-
1. from config file: download plugins according to the tool file in the config
9+
1. from config file: download plugins according to `tools` and `apps` in the config
1010
2. from command line: download plugins according to the command line arguments
1111

1212
## Downloading Plugins from Config File
1313

14-
In this way, `dtm init` will download the required plugins according to the tool file in the config.
14+
In this way, `dtm init` will download the required plugins according to `tools` and `apps` in the config.
1515

16-
**command:** `dtm init` or `dtm init -f <config file>`. The default config file path is `config.yaml`.
16+
**command:** `dtm init -f <config file/config dir>`.
1717

18-
For config file, tool file, see the [config](../core-concepts/config.md) section of this documentation.
18+
You can put all the configuration in one file, or you can spread it out into multiple files in the same directory with `yaml` or `yaml` as a suffix.
19+
20+
For config file, tools and apps, see the [config](../core-concepts/config.md) section of this documentation.
1921

2022
## Downloading Plugins from Command Line
2123

docs/commands/init.zh.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@
66

77
`dtm` 提供了两种下载插件的方式:
88

9-
1. 根据配置文件:根据配置中的 tool file 下载插件
9+
1. 根据配置文件:根据配置中的 `tools``apps` 下载插件
1010
2. 根据命令行参数:根据命令行的参数下载插件
1111

1212
## 根据配置文件下载插件
1313

14-
这种方式下,`dtm init` 将根据配置中的 tool file 下载需要的插件
14+
这种方式下,`dtm init` 将根据配置中定义的 `tools``apps` 下载所需的插件
1515

16-
**命令:** `dtm init``dtm init -f <config file>`。默认的配置文件路径是 `config.yaml`
16+
**命令:** `dtm init -f <config file/config dir>`
1717

18-
关于配置文件、tool file,详见[DevStream 配置](../core-concepts/config.zh.md)
18+
你可以把所有的配置放在一个文件中,也可以把配置分散至同一个目录下的多个以 `yaml``yaml` 为后缀的文件中。
19+
20+
关于配置文件、tools and apps,详见[DevStream 配置](../core-concepts/config.zh.md)
1921

2022
## 根据命令行参数下载插件
2123

docs/quickstart.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Then we run the following commands to update our config file with those env vars
7474
Run:
7575

7676
```shell
77-
./dtm init
77+
./dtm init -f config.yaml
7878
```
7979

8080
!!! success "You should see some output similar to the following"
@@ -108,7 +108,7 @@ Run:
108108
Run:
109109

110110
```shell
111-
./dtm apply -y
111+
./dtm apply -f config.yaml -y
112112
```
113113

114114
!!! success "You should see similar output to the following"
@@ -156,7 +156,7 @@ The commits (made by DevStream when scaffolding the repo and creating workflows)
156156
Run:
157157

158158
```shell
159-
./dtm delete
159+
./dtm delete -f config.yaml
160160
```
161161

162162
Input `y` then press enter to continue, and you should see similar output:

docs/quickstart.zh.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export DOCKERHUB_USERNAME="<YOUR_DOCKER_HUB_USER_NAME_HERE>"
7474
运行:
7575

7676
```shell
77-
./dtm init
77+
./dtm init -f config.yaml
7878
```
7979

8080
!!! success "你会看到类似下面的输出"
@@ -108,7 +108,7 @@ export DOCKERHUB_USERNAME="<YOUR_DOCKER_HUB_USER_NAME_HERE>"
108108
运行:
109109

110110
```shell
111-
./dtm apply -y
111+
./dtm apply -f config.yaml -y
112112
```
113113

114114
!!! success "你会看到类似下面的输出"
@@ -156,7 +156,7 @@ DevStream 在生成仓库脚手架和创建工作流时的代码提交,已经
156156
运行:
157157

158158
```shell
159-
./dtm delete
159+
./dtm delete -f config.yaml
160160
```
161161

162162
输入 `y` 然后回车,你会看到类似下面的输出:

pkg/util/file/yaml_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,12 @@ var _ = Describe("ReadYamls func", func() {
270270
const subDir = "subdir/subsubdir"
271271
filePath = filepath.Join(tempDir, subDir, "test.yml")
272272
err := os.MkdirAll(filepath.Dir(filePath), 0755)
273+
Expect(err).Error().ShouldNot(HaveOccurred())
273274
f, err := os.Create(filePath)
274275
Expect(err).Error().ShouldNot(HaveOccurred())
275276
defer f.Close()
276277
_, err = f.WriteString(contents[len(contents)-1])
278+
Expect(err).Error().ShouldNot(HaveOccurred())
277279
})
278280
It("should return all contents", func() {
279281
filePath = tempDir

0 commit comments

Comments
 (0)