Skip to content

Commit 6ce958f

Browse files
committed
fix: code conflict
Signed-off-by: Meng JiaFeng <[email protected]>
1 parent 7644fcb commit 6ce958f

29 files changed

+472
-323
lines changed

docs/plugins/argocdapp.md

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ This plugin creates an [Argo CD Application](https://argo-cd.readthedocs.io/en/s
99
Or you can use both plugins(argocd+argocdapp) at the same time.
1010
See [GitOps Toolchain](../use-cases/gitops.md) for more info.
1111
- Currently, only the Helm chart is supported when creating the Argo CD application.
12-
- Modify the file accordingly. Especially remember to modify `ARGOCD_TOOL_NAME`.
1312

1413
## Usage
1514

@@ -21,6 +20,35 @@ For more information on the main config, the tool file and the var file of DevSt
2120
--8<-- "argocdapp.yaml"
2221
```
2322

23+
### Automatically Create Helm Configuration
24+
25+
This plugin can push helm configuration automatically when your `source.path` helm config does not exist so that you can use this plugin with helm configured already. For example:
26+
27+
```yaml
28+
---
29+
tools:
30+
- name: go-webapp-argocd-deploy
31+
plugin: argocdapp
32+
dependsOn: ["repo-scaffolding.golang-github"]
33+
options:
34+
app:
35+
name: hello
36+
namespace: argocd
37+
destination:
38+
server: https://kubernetes.default.svc
39+
namespace: default
40+
source:
41+
valuefile: values.yaml
42+
path: charts/go-hello-http
43+
repoURL: https://github.com/devstream-io/testrepo.git
44+
imageRepo:
45+
url: http://test.barbor.com/library
46+
user: test_owner
47+
tag: "1.0.0"
48+
```
49+
50+
This config will push the default [helm config](https://github.com/devstream-io/dtm-pipeline-templates/tree/main/argocdapp/helm)](https://github.com/devstream-io/dtm-pipeline-templates/tree/main/argocdapp/helm) to repo [testrepo](https://github.com/devstream-io/testrepo.git), and the generated config will use the image `http://test.barbor.com/library/test_owner/hello:1.0.0` as the initial image for Helm.
51+
2452
## Use Together with the `repo-scaffolding` Plugin
2553

2654
This plugin can be used together with the `repo-scaffolding` plugin (see document [here](./repo-scaffolding.md).)
@@ -72,32 +100,3 @@ In the example above:
72100
- We used `repo-scaffolding.golang-github`'s output as input for the `github-actions` plugin.
73101

74102
Pay attention to the `${{ xxx }}` part in the example. `${{ TOOL_NAME.PLUGIN.outputs.var}}` is the syntax for using an output.
75-
76-
## Automatically Create Helm Configuration
77-
78-
This plugin can push helm configuration automatically when your source.path helm config not exist, so you can use this plugin with helm configured alreay. For example:
79-
80-
```yaml
81-
---
82-
tools:
83-
- name: go-webapp-argocd-deploy
84-
plugin: argocdapp
85-
dependsOn: ["repo-scaffolding.golang-github"]
86-
options:
87-
app:
88-
name: hello
89-
namespace: argocd
90-
destination:
91-
server: https://kubernetes.default.svc
92-
namespace: default
93-
source:
94-
valuefile: values.yaml
95-
path: charts/go-hello-http
96-
repoURL: ${{repo-scaffolding.golang-github.outputs.repoURL}}
97-
imageRepo:
98-
url: http://test.barbor.com/library
99-
user: test_owner
100-
tag: "1.0.0"
101-
```
102-
103-
This config will push default helm config to repo `${{repo-scaffolding.golang-github.outputs.repoURL}}`, and the generated config will use image `http://test.barbor.com/library/test_owner/hello:1.0.0` as inital image for helm.

docs/plugins/argocdapp.zh.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
11
# argocdapp 插件
22

3-
todo
3+
该插件会创建一个在 Kubernetes 上 [Argo CD Application](https://argo-cd.readthedocs.io/en/stable/core_concepts/) 的自定义资源。
4+
5+
**注意:**
6+
7+
- 在使用该插件前需要先安装 Argocd CD。你可以使用 [helm-installer 插件](./helm-installer/argocd.md) 来安装它。
8+
- 目前该插件只支持 Helm chart 的配置方式。
9+
10+
## 用例
11+
12+
以下内容是该插件的示例配置文件。
13+
14+
```yaml
15+
--8<-- "argocdapp.yaml"
16+
```
17+
18+
### 自动创建 Helm 配置
19+
20+
如果你不想要自己创建 Helm 配置,该插件支持把 Devstream 提供的默认 Helm 配置上传到 `source.path` 的配置路径上,这样你就可以直接使用该插件。配置示例如下:
21+
22+
```yaml
23+
---
24+
tools:
25+
- name: go-webapp-argocd-deploy
26+
plugin: argocdapp
27+
dependsOn: ["repo-scaffolding.golang-github"]
28+
options:
29+
app:
30+
name: hello
31+
namespace: argocd
32+
destination:
33+
server: https://kubernetes.default.svc
34+
namespace: default
35+
source:
36+
valuefile: values.yaml
37+
path: charts/go-hello-http
38+
repoURL: https://github.com/devstream-io/testrepo.git
39+
imageRepo:
40+
url: http://test.barbor.com/library
41+
user: test_owner
42+
tag: "1.0.0"
43+
```
44+
45+
这个示例配置将会把 [Helm 配置](https://github.com/devstream-io/dtm-pipeline-templates/tree/main/argocdapp/helm) 上传到 [testrepo](https://github.com/devstream-io/testrepo.git) 仓库中,生成的 Helm 配置会使用 `http://test.barbor.com/library/test_owner/hello:1.0.0` 作为 Helm 应用的启动镜像。

docs/plugins/ci-generic.md

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ci-generic Plugin
22

3-
This plugin installs ci script in GitLib/GitHub repo from local or remote url.
3+
This plugin installs `CI` script in `GitLib`/`GitHub` repo from a local or remote url.
44

55
## Usage
66

@@ -12,31 +12,16 @@ For more information on the main config, the tool file and the var file of DevSt
1212
--8<-- "ci-generic.yaml"
1313
```
1414

15-
### Field Configs
16-
17-
| key | description |
18-
| ---- | ---- |
19-
| ci.localPath | If your ci file is local, you can set the this field to the ci file location, which can be a directory or a file |
20-
| ci.remoteURL | If your ci file is remote, you can set this field to url address |
21-
| ci.type | ci type, support gitlab, github, jenkins for now |
22-
| projectRepo.owner | destination repo owner |
23-
| projectRepo.org | destination repo org |
24-
| projectRepo.name | destination repo name |
25-
| projectRepo.branch | destination repo branch |
26-
| projectRepo.scmType | destination repo type, support github/gitlab for now |
27-
| projectRepo.baseURL | if you use self-build gitlab, you can set this field to gitlab address |
28-
| projectRepo.visibility | if you use gitlab, you can set this field for repo permission |
29-
3015
**Notes:**
3116

17+
- `projectRepo` config option represents codebase location; for more info, you can refer to [SCM Config](./scm-option.md).
3218
- `ci.localPath` and `ci.remoteURL` can't be empty at the same time.
33-
- if you set both `ci.localPath` and `ci.remoteURL`, `ci.localPath` will be used.
34-
- if your `projectRepo.scmType` is `gitlab`, the `ci.type` is not allowed to be `github`.
35-
- if your `projectRepo.scmType` is `github`, the `ci.type` is not allowed to be `gitlab`.
19+
- if your `projectRepo.scmType` is `gitlab`, the `ci.type` is not allowed to be `github-actions`.
20+
- if your `projectRepo.scmType` is `github`, the `ci.type` is not allowed to be `gitlab-ci`.
3621

37-
### Example
22+
## Example
3823

39-
#### Local WorkFlows With Github
24+
### Local WorkFlows With Github
4025

4126
```yaml
4227
tools:
@@ -56,7 +41,7 @@ tools:
5641
5742
This config will put local workflows directory to GitHub repo's .github/workflows directory.
5843
59-
#### Remote Jenkinsfile With Gitlab
44+
### Remote Jenkinsfile With Gitlab
6045
6146
```yaml
6247
tools:
@@ -75,4 +60,4 @@ tools:
7560
baseURL: http://127.0.0.1:30000
7661
```
7762
78-
This config will put file from [remote](https://raw.githubusercontent.com/DeekshithSN/Jenkinsfile/inputTest/Jenkinsfile) to GitLab repo.
63+
This config will put files from [remote](https://raw.githubusercontent.com/DeekshithSN/Jenkinsfile/inputTest/Jenkinsfile)](https://raw.githubusercontent.com/DeekshithSN/Jenkinsfile/inputTest/Jenkinsfile) to GitLab repo.

docs/plugins/ci-generic.zh.md

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
这个插件可以基于本地或者远程的文件在 GitLab/GitHub 安装 CI 配置
44

5-
## 使用
5+
## 用例
66

77
下面的配置文件展示的是"tool file"的内容。
88

@@ -12,29 +12,16 @@
1212
--8<-- "ci-generic.yaml"
1313
```
1414

15-
### 字段配置
16-
17-
| key | description |
18-
| ---- | ---- |
19-
| ci.configLocation | If your ci file is local or remote, you can set the this field to get ci file |
20-
| ci.configContents | If you want to config ci in devstream, you can config configContents directly |
21-
| ci.type | ci type, support gitlab, github, jenkins for now |
22-
| projectRepo.owner | destination repo owner |
23-
| projectRepo.org | destination repo org |
24-
| projectRepo.name | destination repo name |
25-
| projectRepo.branch | destination repo branch |
26-
| projectRepo.scmType | destination repo type, support github/gitlab for now |
27-
| projectRepo.baseURL | if you use self-build gitlab, you can set this field to gitlab address |
28-
| projectRepo.visibility | if you use gitlab, you can set this field for repo permission |
29-
3015
**注意事项:**
3116

17+
- `projectRepo` 配置字段用于表示代码仓库的配置信息,具体配置可查看[SCM配置项](./scm-option.zh.md)
3218
- `ci.configContents``ci.configLocation` 不能同时为空。
33-
- 如果你同时设置了 `ci.configLocation``ci.configContents``ci.configContents` 将会被优先使用。
19+
- 如果你配置了 `projectRepo.scmType``github`,那 `ci.type` 就不能是 `gitlab-ci`
20+
- 如果你配置了 `projectRepo.scmType``gitlab`,那 `ci.type` 就不能是 `github-actions`
3421

35-
### 示例
22+
## 示例
3623

37-
#### 使用本地的 Workflows 目录
24+
### 使用本地的 Workflows 目录
3825

3926
```yaml
4027
tools:
@@ -54,7 +41,7 @@ tools:
5441
5542
这个配置将会把本地当前运行环境下的 workflows 目录放置于 GitHub 的 `.github/workflows` 目录。
5643

57-
#### 使用 HTTP 获取远程的CI文件
44+
### 使用 HTTP 获取远程的CI文件
5845

5946
```yaml
6047
tools:
@@ -75,7 +62,7 @@ tools:
7562

7663
这个配置将会把[URL](https://raw.githubusercontent.com/DeekshithSN/Jenkinsfile/inputTest/Jenkinsfile) 中的 Jenkinsfile 文件置于 GitLab 的仓库。
7764

78-
#### 使用Github仓库中的CI文件
65+
### 使用Github仓库中的CI文件
7966
```yaml
8067
tools:
8168
- name: ci-generic
@@ -95,7 +82,7 @@ tools:
9582

9683
这个配置将会搜索[devstream 仓库](https://github.com/devstream-io/devstream)下的staging/dtm-jenkins-pipeline-example/general 目录,获取到目录下的 Jenkinsfile,置于 gitlab 仓库内。
9784

98-
#### 在Devstream中直接配置CI文件
85+
### 在Devstream中直接配置CI文件
9986

10087
```yaml
10188
tools:

docs/plugins/github-actions.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
# github-actions plugin
22

3-
TODO(dtm): Add your document here.
3+
This plugin is used to create `Github Workflows` in your project.
44

55
## Usage
66

77
``` yaml
88
--8<-- "github-actions.yaml"
99
```
10+
11+
**Notes:**
12+
13+
- `scm` config option represents codebase location; for more info, you can refer to [SCM Config](./scm-option.md).
14+
- The `pipeline` config option controls `CI` stages; you can refer to [Pipeline Config](./pipeline.md) for more info.

docs/plugins/github-actions.zh.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
# github-actions 插件
22

3-
_该插件用于在项目中创建 Github Action Workflows_
3+
_该插件用于在项目中创建 Github Action Workflows。_
44

55
## 用例
66

7-
_该插件运行依赖以下环境变量:_
8-
9-
- GITHUB_TOKEN
10-
11-
请在使用插件前配置该环境变量。如果你不知道如何创建这个 TOKEN,可以查看以下文档:
12-
13-
- [创建个人访问 token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
14-
157
下面的内容是一个示例配置文件用于创建 Github Workflows:
168

179
``` yaml
1810
--8<-- "github-actions.yaml"
1911
```
2012

21-
该插件的 `pipeline` 选项具体配置可查询[pipline配置项](pipeline.zh.md)
13+
**注意:**
14+
15+
- `scm` 配置字段用于表示代码仓库的配置信息,具体配置可查看[SCM配置项](./scm-option.zh.md)
16+
- `pipeline` 选项项用于控制 `CI` 流程中的各个阶段,具体配置可查看文档[pipline配置项](pipeline.zh.md)

docs/plugins/gitlab-ci.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,21 @@
22

33
This plugin creates GitLab CI workflow.
44

5-
It downloads a template of your choice, render it with provided parameters, and creates a GitLab CI file to your repo.
5+
It downloads a template of your choice, renders it with provided parameters, and creates a GitLab CI file for your repo.
66

77
## Usage
88

9-
_This plugin depends on an environment variable "GITLAB_TOKEN", which is your GitLab personal access token._
10-
11-
TL;DR: if you are using gitlab.com (instead of a self-hosted GitLab), [click here](https://gitlab.com/-/profile/personal_access_tokens?name=DevStream+Access+token&scopes=api) to create a token for DevStream (the scope contains API only.)
12-
13-
If you are using self-hosted GitLab, refer to the [official doc here](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html) for more info.
14-
15-
_Note: when creating the token, make sure you select "API" in the "scopes" section, as DevStream uses GitLab API to add CI workflow files._
16-
179
The following content is an example of the "tool file".
1810

19-
For more information on the main config, the tool file and the var file of DevStream, see [Core Concepts Overview](../core-concepts/overview.md) and [DevStream Configuration](../core-concepts/config.md).
11+
For more information on the main config, the tool file, and the var file of DevStream, see [Core Concepts Overview](../core-concepts/overview.md) and [DevStream Configuration](../core-concepts/config.md).
2012

2113
Plugin config example:
2214

2315
```yaml
2416
--8<-- "gitlab-ci.yaml"
2517
```
2618

27-
Or, run `dtm show config --plugin=gitlab-ci` to get the default config.
19+
**Notes:**
2820

29-
All parameters are mandatory.
21+
- `scm` config option represents codebase location; for more info, you can refer to [SCM Config](./scm-option.md).
22+
- The `pipeline` config option controls `CI` stages; you can refer to [Pipeline Config](./pipeline.md) for more info.

docs/plugins/gitlab-ci.zh.md

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
# gitlab-ci 插件
22

3-
_该插件用于在使用 gitlab 的项目仓库中创建 Gitlab CI 并运行对应项目的 gitlab runner_
4-
5-
## 用例
6-
7-
_该插件运行依赖以下环境变量:_
8-
9-
- GITLAB_TOKEN
10-
11-
请在使用插件前配置该环境变量。如果你不知道如何创建这个 TOKEN,可以查看以下文档:
12-
13-
- 如果你使用的是官方提供的仓库(非自搭建的 `Gitlab`),可以查看该[链接](https://gitlab.com/-/profile/personal_access_tokens?name=DevStream+Access+token&scopes=api) 来创建一个用于 Devstream 的 token。
14-
- 如果你使用自搭建的 `Gitlab` 仓库,可以查看该[链接](https://gitlab.com/-/profile/personal_access_tokens?name=DevStream+Access+token&scopes=api)来创建一个用于 Devstream 的 token。
3+
该插件用于在使用 gitlab 的项目仓库中创建 Gitlab CI 并运行对应项目的 gitlab runner。
154

165
### 配置项
176
下面的内容是一个示例配置文件用于创建 Gitlab CI:
@@ -20,4 +9,7 @@ _该插件运行依赖以下环境变量:_
209
--8<-- "gitlab-ci.yaml"
2110
```
2211

23-
该插件的 `pipeline` 选项具体配置可查询[pipline配置项](pipeline.zh.md)
12+
**注意:**
13+
14+
- `scm` 配置字段用于表示代码仓库的配置信息,具体配置可查看[SCM配置项](./scm-option.zh.md)
15+
- `pipeline` 选项项用于控制 `CI` 流程中的各个阶段,具体配置可查看文档[pipline配置项](pipeline.zh.md)

docs/plugins/jenkins-pipeline.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# jenkins-pipeline Plugin
22

3-
TODO(dtm): Add your document here.
3+
This plugin is used to create a `Jenkins Pipeline` for Github/Gitlab Repo.
44

55
## Usage
66

@@ -11,3 +11,9 @@ For more information on the main config, the tool file and the var file of DevSt
1111
``` yaml
1212
--8<-- "jenkins-pipeline.yaml"
1313
```
14+
15+
**Notes:**
16+
17+
- `scm` config option represents codebase location; for more info, you can refer to [SCM Config](./scm-option.md).
18+
- The `pipeline` config option controls `CI` stages; you can refer to [Pipeline Config](./pipeline.md) for more info.
19+
- `jenkins.token` is the password of `jenkins.user`.

0 commit comments

Comments
 (0)