Skip to content

Commit 93b6a5c

Browse files
authored
Merge pull request #1335 from merico-dev/refactor-github-actions-clean
refactor: delete github-action languages plugin
2 parents 0a52df8 + 8d67c63 commit 93b6a5c

File tree

85 files changed

+385
-1669
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+385
-1669
lines changed

cmd/plugin/github-actions/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package main
22

33
import (
44
"github.com/devstream-io/devstream/internal/pkg/configmanager"
5-
"github.com/devstream-io/devstream/internal/pkg/plugin/githubactions/general"
5+
general "github.com/devstream-io/devstream/internal/pkg/plugin/githubactions"
66
"github.com/devstream-io/devstream/internal/pkg/statemanager"
77
"github.com/devstream-io/devstream/pkg/util/log"
88
)

cmd/plugin/githubactions-golang/main.go

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

cmd/plugin/githubactions-nodejs/main.go

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

cmd/plugin/githubactions-python/main.go

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

docs/best-practices/gitops.md

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ However, if you are like us, who prefer to do things hands-on and get their hand
4141
DevStream will use the following plugins to achieve the goal described in [Section 0](#0-goal):
4242

4343
1. [repo-scaffolding](../plugins/repo-scaffolding.md)
44-
2. [githubactions-golang](../plugins/githubactions-golang.md)
44+
2. [github-actions](../plugins/github-actions.md)
4545
3. [helm-installer](../plugins/helm-installer/helm-installer.md)
4646
4. [argocdapp](../plugins/argocdapp.md)
4747

@@ -138,34 +138,33 @@ tools:
138138
options:
139139
destinationRepo:
140140
owner: [[ githubUser ]]
141-
repo: [[ app ]]
141+
name: [[ app ]]
142142
branch: main
143-
repoType: github
143+
scmType: github
144144
sourceRepo:
145145
org: devstream-io
146-
repo: dtm-repo-scaffolding-python
147-
repoType: github
148-
vars:
149-
imageRepo: [[ dockerUser ]]/[[ app ]]
150-
- name: githubactions-python
151-
instanceID: default
146+
name: dtm-scaffolding-flask
147+
scmType: github
148+
- name: github-actions
149+
instanceID: flask
152150
dependsOn: [ repo-scaffolding.myapp ]
153151
options:
154-
owner: [[ githubUser ]]
155-
repo: [[ app ]]
156-
language:
157-
name: python
158-
branch: main
159-
docker:
160-
registry:
161-
type: dockerhub
162-
username: [[ dockerUser ]]
163-
repository: [[ app ]]
152+
scm:
153+
owner: [[ githubUser ]]
154+
name: [[ app ]]
155+
scmType: github
156+
pipeline:
157+
configLocation: https://raw.githubusercontent.com/devstream-io/ci-template/main/github-actions/workflows/main.yml
158+
language:
159+
name: python
160+
framework: flask
161+
imageRepo:
162+
user: [[ dockerUser ]]
164163
- name: helm-installer
165164
instanceID: argocd
166165
- name: argocdapp
167166
instanceID: default
168-
dependsOn: [ "helm-installer.argocd", "githubactions-python.default" ]
167+
dependsOn: [ "helm-installer.argocd", "github-actions.flask" ]
169168
options:
170169
app:
171170
name: [[ app ]]
@@ -177,6 +176,8 @@ tools:
177176
valuefile: values.yaml
178177
path: helm/[[ app ]]
179178
repoURL: ${{repo-scaffolding.myapp.outputs.repoURL}}
179+
imageRepo:
180+
user: [[ dockerUser ]]
180181
```
181182
182183
Then modify the `vars` section in the `config.yaml` file accordingly. Please update the values for `githubUser` and `dockerUser` to your real users.
@@ -194,15 +195,15 @@ The following environment variables are required for this to work:
194195
195196
```bash
196197
export GITHUB_TOKEN="YOUR_GITHUB_TOKEN_HERE"
197-
export DOCKERHUB_TOKEN="YOUR_DOCKERHUB_TOKEN_HERE"
198+
export IMAGE_REPO_PASSWORD="YOUR_DOCKERHUB_TOKEN_HERE"
198199
```
199200
200201
> Note:
201202
>
202203
> if you don't know how to create these two tokens, check out:
203204
>
204205
> - GITHUB_TOKEN: [Manage API tokens for your Atlassian account](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
205-
> - DOCKERHUB_TOKEN: [Manage access tokens](https://docs.docker.com/docker-hub/access-tokens/)
206+
> - IMAGE_REPO_PASSWORD: [Manage access tokens](https://docs.docker.com/docker-hub/access-tokens/)
206207
207208
---
208209
@@ -220,7 +221,7 @@ You'll get some outputs similar to the following:
220221
221222
```bash
222223
2022-12-05 17:46:01 ℹ [INFO] Using dir </Users/tiexin/.devstream/plugins> to store plugins.
223-
2022-12-05 17:46:01 ℹ [INFO] -------------------- [ repo-scaffolding-darwin-arm64_0.10.1 ] --------------------
224+
2022-12-05 17:46:01 ℹ [INFO] -------------------- [ repo-scaffolding-darwin-arm64_0.10.2 ] --------------------
224225
... (omitted)
225226
... (omitted)
226227
2022-12-05 17:46:51 ✔ [SUCCESS] Initialize finished.
@@ -243,7 +244,7 @@ You will see similar outputs as the following:
243244
2022-12-05 17:49:49 ℹ [INFO] Using local backend. State file: devstream.state.
244245
2022-12-05 17:49:49 ℹ [INFO] Tool (repo-scaffolding/myapp) found in config but doesn't exist in the state, will be created.
245246
2022-12-05 17:49:49 ℹ [INFO] Tool (helm-installer/argocd) found in config but doesn't exist in the state, will be created.
246-
2022-12-05 17:49:49 ℹ [INFO] Tool (githubactions-python/default) found in config but doesn't exist in the state, will be created.
247+
2022-12-05 17:49:49 ℹ [INFO] Tool (github-actions/flask) found in config but doesn't exist in the state, will be created.
247248
2022-12-05 17:49:49 ℹ [INFO] Tool (argocdapp/default) found in config but doesn't exist in the state, will be created.
248249
2022-12-05 17:49:49 ℹ [INFO] Start executing the plan.
249250
2022-12-05 17:49:49 ℹ [INFO] Changes count: 4.
@@ -341,7 +342,7 @@ And you will get similar outputs to the following:
341342
2022-12-05 17:59:25 ℹ [INFO] Delete started.
342343
2022-12-05 17:59:26 ℹ [INFO] Using local backend. State file: devstream.state.
343344
2022-12-05 17:59:26 ℹ [INFO] Tool (argocdapp/default) will be deleted.
344-
2022-12-05 17:59:26 ℹ [INFO] Tool (githubactions-python/default) will be deleted.
345+
2022-12-05 17:59:26 ℹ [INFO] Tool (github-actions/flask) will be deleted.
345346
2022-12-05 17:59:26 ℹ [INFO] Tool (repo-scaffolding/myapp) will be deleted.
346347
2022-12-05 17:59:26 ℹ [INFO] Tool (helm-installer/argocd) will be deleted.
347348
2022-12-05 17:59:26 ℹ [INFO] Start executing the plan.

docs/best-practices/gitops.zh.md

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
DevStream 将使用下面的插件来实现[第 0 节](#0-目标)中描述的目标:
4242

4343
1. [repo-scaffolding](../plugins/repo-scaffolding.md)
44-
2. [githubactions-golang](../plugins/githubactions-golang.md)
44+
2. [github-actions](../plugins/github-actions.md)
4545
3. [helm-installer](../plugins/helm-installer/helm-installer.md)
4646
4. [argocdapp](../plugins/argocdapp.md)
4747

@@ -138,34 +138,33 @@ tools:
138138
options:
139139
destinationRepo:
140140
owner: [[ githubUser ]]
141-
repo: [[ app ]]
141+
name: [[ app ]]
142142
branch: main
143-
repoType: github
143+
scmType: github
144144
sourceRepo:
145145
org: devstream-io
146-
repo: dtm-repo-scaffolding-python
147-
repoType: github
148-
vars:
149-
imageRepo: [[ dockerUser ]]/[[ app ]]
150-
- name: githubactions-python
151-
instanceID: default
146+
name: dtm-scaffolding-flask
147+
scmType: github
148+
- name: github-actions
149+
instanceID: flask
152150
dependsOn: [ repo-scaffolding.myapp ]
153151
options:
154-
owner: [[ githubUser ]]
155-
repo: [[ app ]]
156-
language:
157-
name: python
158-
branch: main
159-
docker:
160-
registry:
161-
type: dockerhub
162-
username: [[ dockerUser ]]
163-
repository: [[ app ]]
152+
scm:
153+
owner: [[ githubUser ]]
154+
name: [[ app ]]
155+
scmType: github
156+
pipeline:
157+
configLocation: https://raw.githubusercontent.com/devstream-io/ci-template/main/github-actions/workflows/main.yml
158+
language:
159+
name: python
160+
framework: flask
161+
imageRepo:
162+
user: [[ dockerUser ]]
164163
- name: helm-installer
165164
instanceID: argocd
166165
- name: argocdapp
167166
instanceID: default
168-
dependsOn: [ "helm-installer.argocd", "githubactions-python.default" ]
167+
dependsOn: [ "helm-installer.argocd", "github-actions.flask" ]
169168
options:
170169
app:
171170
name: [[ app ]]
@@ -177,6 +176,8 @@ tools:
177176
valuefile: values.yaml
178177
path: helm/[[ app ]]
179178
repoURL: ${{repo-scaffolding.myapp.outputs.repoURL}}
179+
imageRepo:
180+
user: [[ dockerUser ]]
180181
```
181182
182183
按需修改 `config.yaml` 文件中的 `vars` 部分。记得修改 `githubUser``dockerUser` 的值为你自己的用户名。
@@ -194,14 +195,14 @@ tools:
194195
195196
```bash
196197
export GITHUB_TOKEN="YOUR_GITHUB_TOKEN_HERE"
197-
export DOCKERHUB_TOKEN="YOUR_DOCKERHUB_TOKEN_HERE"
198+
export IMAGE_REPO_PASSWORD="YOUR_DOCKERHUB_TOKEN_HERE"
198199
```
199200
200201
> 提示:
201202
> 如果你不知道如何创建这两个 token,可以参考:
202203
>
203204
> - GITHUB_TOKEN:[Manage API tokens for your Atlassian account](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
204-
> - DOCKERHUB_TOKEN:[Manage access tokens](https://docs.docker.com/docker-hub/access-tokens/)
205+
> - IMAGE_REPO_PASSWORD:[Manage access tokens](https://docs.docker.com/docker-hub/access-tokens/)
205206
206207
---
207208
@@ -240,7 +241,7 @@ export DOCKERHUB_TOKEN="YOUR_DOCKERHUB_TOKEN_HERE"
240241
2022-12-05 17:49:49 ℹ [INFO] Using local backend. State file: devstream.state.
241242
2022-12-05 17:49:49 ℹ [INFO] Tool (repo-scaffolding/myapp) found in config but doesn't exist in the state, will be created.
242243
2022-12-05 17:49:49 ℹ [INFO] Tool (helm-installer/argocd) found in config but doesn't exist in the state, will be created.
243-
2022-12-05 17:49:49 ℹ [INFO] Tool (githubactions-python/default) found in config but doesn't exist in the state, will be created.
244+
2022-12-05 17:49:49 ℹ [INFO] Tool (github-actions/flask) found in config but doesn't exist in the state, will be created.
244245
2022-12-05 17:49:49 ℹ [INFO] Tool (argocdapp/default) found in config but doesn't exist in the state, will be created.
245246
2022-12-05 17:49:49 ℹ [INFO] Start executing the plan.
246247
2022-12-05 17:49:49 ℹ [INFO] Changes count: 4.
@@ -338,7 +339,7 @@ kubectl port-forward -n default svc/helloworld 8080:80
338339
2022-12-05 17:59:25 ℹ [INFO] Delete started.
339340
2022-12-05 17:59:26 ℹ [INFO] Using local backend. State file: devstream.state.
340341
2022-12-05 17:59:26 ℹ [INFO] Tool (argocdapp/default) will be deleted.
341-
2022-12-05 17:59:26 ℹ [INFO] Tool (githubactions-python/default) will be deleted.
342+
2022-12-05 17:59:26 ℹ [INFO] Tool (github-actions/flask) will be deleted.
342343
2022-12-05 17:59:26 ℹ [INFO] Tool (repo-scaffolding/myapp) will be deleted.
343344
2022-12-05 17:59:26 ℹ [INFO] Tool (helm-installer/argocd) will be deleted.
344345
2022-12-05 17:59:26 ℹ [INFO] Start executing the plan.

docs/commands/init.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This can be used to pre-download the plugin to use `dtm` in an **offline environ
2525

2626
command:
2727

28-
- download specify plugins. e.g. `dtm init --download-only --plugins="repo-scaffolding, githubactions-golang" -d=.devstream/plugins`
28+
- download specify plugins. e.g. `dtm init --download-only --plugins="repo-scaffolding, github-actions" -d=.devstream/plugins`
2929
- download all plugins. e.g. `dtm init --download-only --all -d=.devstream/plugins`
3030

3131
## Init Logic

docs/commands/init.zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
**命令:**
2727

28-
- 下载指定插件,如:`dtm init --download-only --plugins="repo-scaffolding, githubactions-golang" -d=.devstream/plugins`
28+
- 下载指定插件,如:`dtm init --download-only --plugins="repo-scaffolding, github-actions" -d=.devstream/plugins`
2929
- 下载所有插件,如:`dtm init --download-only --all -d=.devstream/plugins`
3030

3131

0 commit comments

Comments
 (0)