From 30e806545497ff823474cad49b8259eb1eed5b4f Mon Sep 17 00:00:00 2001 From: Daniel Hu Date: Fri, 15 Apr 2022 09:36:10 +0800 Subject: [PATCH 1/2] chore: adding the missing config field for most plugins Signed-off-by: Daniel Hu --- docs/plugins/argocd.md | 3 +++ docs/plugins/devlake.md | 2 ++ .../plugins/github-repo-scaffolding-golang.md | 2 ++ docs/plugins/gitlabci-generic.md | 3 +++ docs/plugins/gitlabci-golang.md | 2 ++ docs/plugins/jenkins.md | 2 ++ docs/plugins/jira-github-integ.md | 2 ++ docs/plugins/kube-prometheus.md | 2 ++ docs/plugins/openldap.md | 3 +++ docs/plugins/trello-github-integ.md | 21 ++++++------------- docs/plugins/trello.md | 4 +++- internal/pkg/show/config/plugin/argocd.go | 3 +++ internal/pkg/show/config/plugin/devlake.go | 4 +++- .../plugin/github-repo-scaffolding-golang.go | 2 ++ .../show/config/plugin/gitlabci-generic.go | 3 +++ .../pkg/show/config/plugin/gitlabci-golang.go | 2 ++ internal/pkg/show/config/plugin/jenkins.go | 2 ++ .../show/config/plugin/jira-github-integ.go | 2 ++ .../pkg/show/config/plugin/kube-prometheus.go | 2 ++ internal/pkg/show/config/plugin/openldap.go | 5 ++++- .../show/config/plugin/trello-github-integ.go | 18 +++++----------- internal/pkg/show/config/plugin/trello.go | 4 +++- 22 files changed, 61 insertions(+), 32 deletions(-) diff --git a/docs/plugins/argocd.md b/docs/plugins/argocd.md index e8ccf6edb..4e672d528 100644 --- a/docs/plugins/argocd.md +++ b/docs/plugins/argocd.md @@ -9,6 +9,9 @@ tools: - name: argocd # name of the plugin plugin: argocd + # if specified, dtm will make sure the dependency is applied first before handling this tool. + dependsOn: [ "TOOL1_NAME.TOOL1_PLUGIN", "TOOL2_NAME.TOOL2_PLUGIN" ] + # options for the plugin options: # need to create the namespace or not, default: false create_namespace: true diff --git a/docs/plugins/devlake.md b/docs/plugins/devlake.md index 2dbeebaf0..1d1cc9a19 100644 --- a/docs/plugins/devlake.md +++ b/docs/plugins/devlake.md @@ -11,6 +11,8 @@ tools: - name: devlake # name of the plugin plugin: devlake + # if specified, dtm will make sure the dependency is applied first before handling this tool. + dependsOn: [ "TOOL1_NAME.TOOL1_PLUGIN", "TOOL2_NAME.TOOL2_PLUGIN" ] ``` All the parameters in the example above are mandatory. diff --git a/docs/plugins/github-repo-scaffolding-golang.md b/docs/plugins/github-repo-scaffolding-golang.md index d2789e7a8..59fb6be92 100644 --- a/docs/plugins/github-repo-scaffolding-golang.md +++ b/docs/plugins/github-repo-scaffolding-golang.md @@ -27,6 +27,8 @@ tools: - name: go-webapp-repo # name of the plugin plugin: github-repo-scaffolding-golang + # if specified, dtm will make sure the dependency is applied first before handling this tool. + dependsOn: [ "TOOL1_NAME.TOOL1_PLUGIN", "TOOL2_NAME.TOOL2_PLUGIN" ] # options for the plugin options: # the repo's owner. It should be case-sensitive here; strictly use your GitHub user name; please change the value below. diff --git a/docs/plugins/gitlabci-generic.md b/docs/plugins/gitlabci-generic.md index 8e5e0f6c8..733c1e4fc 100644 --- a/docs/plugins/gitlabci-generic.md +++ b/docs/plugins/gitlabci-generic.md @@ -21,6 +21,9 @@ tools: - name: myapp-ci # name of the plugin plugin: gitlabci-generic + # optional; if specified, dtm will make sure the dependency is applied first before handling this tool. + dependsOn: [ "TOOL1_NAME.TOOL1_PLUGIN", "TOOL2_NAME.TOOL2_PLUGIN" ] + # options for the plugin options: # owner/repo; "path with namespace" is only GitLab API's way of saying the same thing; please change the values below. pathWithNamespace: YOUR_GITLAB_USERNAME/YOUR_GITLAB_REPO_NAME diff --git a/docs/plugins/gitlabci-golang.md b/docs/plugins/gitlabci-golang.md index 4793bb87f..3c371e738 100644 --- a/docs/plugins/gitlabci-golang.md +++ b/docs/plugins/gitlabci-golang.md @@ -19,6 +19,8 @@ tools: - name: go-hello-world # name of the plugin plugin: gitlabci-golang + # optional; if specified, dtm will make sure the dependency is applied first before handling this tool. + dependsOn: [ "TOOL1_NAME.TOOL1_PLUGIN", "TOOL2_NAME.TOOL2_PLUGIN" ] # options for the plugin options: # owner/repo; "path with namespace" is only GitLab API's way of saying the same thing; please change the values below. diff --git a/docs/plugins/jenkins.md b/docs/plugins/jenkins.md index 7953863fe..0d69632cb 100644 --- a/docs/plugins/jenkins.md +++ b/docs/plugins/jenkins.md @@ -19,6 +19,8 @@ tools: - name: jenkins-dev # name of the plugin plugin: jenkins + # optional; if specified, dtm will make sure the dependency is applied first before handling this tool. + dependsOn: [ "TOOL1_NAME.TOOL1_PLUGIN", "TOOL2_NAME.TOOL2_PLUGIN" ] # options for the plugin options: # need to create the namespace or not, default: false diff --git a/docs/plugins/jira-github-integ.md b/docs/plugins/jira-github-integ.md index 88773f45c..a23484d76 100644 --- a/docs/plugins/jira-github-integ.md +++ b/docs/plugins/jira-github-integ.md @@ -25,6 +25,8 @@ tools: - name: default # name of the plugin plugin: jira-github-integ + # optional; if specified, dtm will make sure the dependency is applied first before handling this tool. + dependsOn: [ "TOOL1_NAME.TOOL1_PLUGIN", "TOOL2_NAME.TOOL2_PLUGIN" ] # options for the plugin options: # the repo's owner diff --git a/docs/plugins/kube-prometheus.md b/docs/plugins/kube-prometheus.md index 303a93a97..2dca336ee 100644 --- a/docs/plugins/kube-prometheus.md +++ b/docs/plugins/kube-prometheus.md @@ -10,6 +10,8 @@ tools: - name: kube-prometheus-dev # name of the plugin plugin: kube-prometheus + # optional; if specified, dtm will make sure the dependency is applied first before handling this tool. + dependsOn: [ "TOOL1_NAME.TOOL1_PLUGIN", "TOOL2_NAME.TOOL2_PLUGIN" ] # options for the plugin options: # need to create the namespace or not, default: false diff --git a/docs/plugins/openldap.md b/docs/plugins/openldap.md index 18e81b89f..67a90bf3c 100644 --- a/docs/plugins/openldap.md +++ b/docs/plugins/openldap.md @@ -9,6 +9,9 @@ tools: - name: openldap # name of the plugin plugin: openldap + # optional; if specified, dtm will make sure the dependency is applied first before handling this tool. + dependsOn: [ "TOOL1_NAME.TOOL1_PLUGIN", "TOOL2_NAME.TOOL2_PLUGIN" ] + # options for the plugin options: # need to create the namespace or not, default: false create_namespace: true diff --git a/docs/plugins/trello-github-integ.md b/docs/plugins/trello-github-integ.md index b8ca103aa..77afca580 100644 --- a/docs/plugins/trello-github-integ.md +++ b/docs/plugins/trello-github-integ.md @@ -9,33 +9,24 @@ This plugin depends on and can be used together with the `trello` plugin (see do `trello-github-integ` plugin can also use `trello` plugin's outputs as input. See the example below: ```yaml -tools: -- name: my-trello-board - # name of the plugin - plugin: trello - dependsOn: ["demo.github-repo-scaffolding-golang"] - options: - owner: YOUR_GITHUB_USERNAME - repo: YOUR_REPO_NAME - kanbanBoardName: KANBAN_BOARD_NAME - name: trello-github # name of the plugin plugin: trello-github-integ # optional; if specified, dtm will make sure the dependency is applied first before handling this tool. - dependsOn: [ "my-trello-board.trello" ] + dependsOn: [ "TRELLO_TOOL_NAME.trello" ] # options for the plugin options: # the repo's owner. It should be case-sensitive here; strictly use your GitHub user name; please change the value below. owner: YOUR_GITHUB_USERNAME + # the repo where you'd like to setup GitHub Actions; please change the value below. # the repo's org. If you set this property, then the new repo will be created under the org you're given, and the "owner" setting above will be ignored. org: YOUR_ORGANIZATION_NAME - # the repo where you'd like to setup GitHub Actions; please change the value below. repo: YOUR_REPO_NAME # reference parameters come from dependency, their usage will be explained later - boardId: ${{ my-trello-board.trello.outputs.boardId }} - todoListId: ${{ my-trello-board.trello.outputs.todoListId }} - doingListId: ${{ my-trello-board.trello.outputs.doingListId }} - doneListId: ${{ my-trello-board.trello.outputs.doneListId }} + boardId: ${{ TRELLO_TOOL_NAME.trello.outputs.boardId }} + todoListId: ${{ TRELLO_TOOL_NAME.trello.outputs.todoListId }} + doingListId: ${{ TRELLO_TOOL_NAME.trello.outputs.doingListId }} + doneListId: ${{ TRELLO_TOOL_NAME.trello.outputs.doneListId }} # main branch of the repo (to which branch the plugin will submit the workflows) branch: main ``` diff --git a/docs/plugins/trello.md b/docs/plugins/trello.md index f736166fc..e5f1f3e2f 100644 --- a/docs/plugins/trello.md +++ b/docs/plugins/trello.md @@ -21,7 +21,9 @@ tools: - name: my-trello-board # name of the plugin plugin: trello - # options for the plugin, checkout the version from the GitHub releases + # optional; if specified, dtm will make sure the dependency is applied first before handling this tool + dependsOn: [ "TOOL1_NAME.TOOL1_PLUGIN", "TOOL2_NAME.TOOL2_PLUGIN" ] + # options for the plugin options: # the repo's owner owner: YOUR_GITHUB_USERNAME diff --git a/internal/pkg/show/config/plugin/argocd.go b/internal/pkg/show/config/plugin/argocd.go index e4079ad01..c29b104fc 100644 --- a/internal/pkg/show/config/plugin/argocd.go +++ b/internal/pkg/show/config/plugin/argocd.go @@ -4,6 +4,9 @@ var ArgocdDefaultConfig = `tools: - name: argocd # name of the plugin plugin: argocd + # if specified, dtm will make sure the dependency is applied first before handling this tool. + dependsOn: [ "TOOL1_NAME.TOOL1_PLUGIN", "TOOL2_NAME.TOOL2_PLUGIN" ] + # options for the plugin options: # need to create the namespace or not, default: false create_namespace: true diff --git a/internal/pkg/show/config/plugin/devlake.go b/internal/pkg/show/config/plugin/devlake.go index 1e27ce73f..af9408b17 100644 --- a/internal/pkg/show/config/plugin/devlake.go +++ b/internal/pkg/show/config/plugin/devlake.go @@ -3,4 +3,6 @@ package plugin var DevlakeDefaultConfig = `tools: - name: devlake # name of the plugin - plugin: devlake` + plugin: devlake + # if specified, dtm will make sure the dependency is applied first before handling this tool. + dependsOn: [ "TOOL1_NAME.TOOL1_PLUGIN", "TOOL2_NAME.TOOL2_PLUGIN" ]` diff --git a/internal/pkg/show/config/plugin/github-repo-scaffolding-golang.go b/internal/pkg/show/config/plugin/github-repo-scaffolding-golang.go index 946c18b26..05dcabc7b 100644 --- a/internal/pkg/show/config/plugin/github-repo-scaffolding-golang.go +++ b/internal/pkg/show/config/plugin/github-repo-scaffolding-golang.go @@ -5,6 +5,8 @@ var GithubRepoScaffoldingGolangDefaultConfig = `tools: - name: go-webapp-repo # name of the plugin plugin: github-repo-scaffolding-golang + # if specified, dtm will make sure the dependency is applied first before handling this tool. + dependsOn: [ "TOOL1_NAME.TOOL1_PLUGIN", "TOOL2_NAME.TOOL2_PLUGIN" ] # options for the plugin options: # the repo's owner. It should be case-sensitive here; strictly use your GitHub user name; please change the value below. diff --git a/internal/pkg/show/config/plugin/gitlabci-generic.go b/internal/pkg/show/config/plugin/gitlabci-generic.go index 60a3a89eb..966a90ec0 100644 --- a/internal/pkg/show/config/plugin/gitlabci-generic.go +++ b/internal/pkg/show/config/plugin/gitlabci-generic.go @@ -4,6 +4,9 @@ var GitlabCIGenericDefaultConfig = `tools: - name: myapp-ci # name of the plugin plugin: gitlabci-generic + # optional; if specified, dtm will make sure the dependency is applied first before handling this tool. + dependsOn: [ "TOOL1_NAME.TOOL1_PLUGIN", "TOOL2_NAME.TOOL2_PLUGIN" ] + # options for the plugin options: # owner/repo; "path with namespace" is only GitLab API's way of saying the same thing; please change the values below. pathWithNamespace: YOUR_GITLAB_USERNAME/YOUR_GITLAB_REPO_NAME diff --git a/internal/pkg/show/config/plugin/gitlabci-golang.go b/internal/pkg/show/config/plugin/gitlabci-golang.go index 062daedd6..62c6526c1 100644 --- a/internal/pkg/show/config/plugin/gitlabci-golang.go +++ b/internal/pkg/show/config/plugin/gitlabci-golang.go @@ -4,6 +4,8 @@ var GitlabCIGolangDefaultConfig = `tools: - name: go-hello-world # name of the plugin plugin: gitlabci-golang + # optional; if specified, dtm will make sure the dependency is applied first before handling this tool. + dependsOn: [ "TOOL1_NAME.TOOL1_PLUGIN", "TOOL2_NAME.TOOL2_PLUGIN" ] # options for the plugin options: # owner/repo; "path with namespace" is only GitLab API's way of saying the same thing; please change the values below. diff --git a/internal/pkg/show/config/plugin/jenkins.go b/internal/pkg/show/config/plugin/jenkins.go index 744576231..bb1d7483a 100644 --- a/internal/pkg/show/config/plugin/jenkins.go +++ b/internal/pkg/show/config/plugin/jenkins.go @@ -5,6 +5,8 @@ var JenkinsDefaultConfig = `tools: - name: jenkins-dev # name of the plugin plugin: jenkins + # optional; if specified, dtm will make sure the dependency is applied first before handling this tool. + dependsOn: [ "TOOL1_NAME.TOOL1_PLUGIN", "TOOL2_NAME.TOOL2_PLUGIN" ] # options for the plugin options: # need to create the namespace or not, default: false diff --git a/internal/pkg/show/config/plugin/jira-github-integ.go b/internal/pkg/show/config/plugin/jira-github-integ.go index 7705f5baa..8977601f8 100644 --- a/internal/pkg/show/config/plugin/jira-github-integ.go +++ b/internal/pkg/show/config/plugin/jira-github-integ.go @@ -4,6 +4,8 @@ var JiraGithubDefaultConfig = `tools: - name: default # name of the plugin plugin: jira-github-integ + # optional; if specified, dtm will make sure the dependency is applied first before handling this tool. + dependsOn: [ "TOOL1_NAME.TOOL1_PLUGIN", "TOOL2_NAME.TOOL2_PLUGIN" ] # options for the plugin options: # the repo's owner diff --git a/internal/pkg/show/config/plugin/kube-prometheus.go b/internal/pkg/show/config/plugin/kube-prometheus.go index 00aa09ada..42c8316b2 100644 --- a/internal/pkg/show/config/plugin/kube-prometheus.go +++ b/internal/pkg/show/config/plugin/kube-prometheus.go @@ -5,6 +5,8 @@ var KubePrometheusDefaultConfig = `tools: - name: kube-prometheus-dev # name of the plugin plugin: kube-prometheus + # optional; if specified, dtm will make sure the dependency is applied first before handling this tool. + dependsOn: [ "TOOL1_NAME.TOOL1_PLUGIN", "TOOL2_NAME.TOOL2_PLUGIN" ] # options for the plugin options: # need to create the namespace or not, default: false diff --git a/internal/pkg/show/config/plugin/openldap.go b/internal/pkg/show/config/plugin/openldap.go index 860a2f42d..bbc6a8c7a 100644 --- a/internal/pkg/show/config/plugin/openldap.go +++ b/internal/pkg/show/config/plugin/openldap.go @@ -4,6 +4,9 @@ var OpenldapDefaultConfig = `tools: - name: openldap # name of the plugin plugin: openldap + # optional; if specified, dtm will make sure the dependency is applied first before handling this tool. + dependsOn: [ "TOOL1_NAME.TOOL1_PLUGIN", "TOOL2_NAME.TOOL2_PLUGIN" ] + # options for the plugin options: # need to create the namespace or not, default: false create_namespace: true @@ -31,7 +34,7 @@ var OpenldapDefaultConfig = `tools: type: NodePort env: LDAP_ORGANISATION: "DevStream Inc." - LDAP_DOMAIN: "devstream.org" + LDAP_DOMAIN: "devstream.io" persistence: enabled: false adminPassword: Not@SecurePassw0rd diff --git a/internal/pkg/show/config/plugin/trello-github-integ.go b/internal/pkg/show/config/plugin/trello-github-integ.go index 0a8819387..c8f3021ce 100644 --- a/internal/pkg/show/config/plugin/trello-github-integ.go +++ b/internal/pkg/show/config/plugin/trello-github-integ.go @@ -1,19 +1,11 @@ package plugin var TrelloGithubDefaultConfig = `tools: -- name: my-trello-board - # name of the plugin - plugin: trello - dependsOn: ["demo.github-repo-scaffolding-golang"] - options: - owner: YOUR_GITHUB_USERNAME - repo: YOUR_REPO_NAME - kanbanBoardName: KANBAN_BOARD_NAME - name: trello-github # name of the plugin plugin: trello-github-integ # optional; if specified, dtm will make sure the dependency is applied first before handling this tool. - dependsOn: [ "my-trello-board.trello" ] + dependsOn: [ "TRELLO_TOOL_NAME.trello" ] # options for the plugin options: # the repo's owner. It should be case-sensitive here; strictly use your GitHub user name; please change the value below. @@ -23,9 +15,9 @@ var TrelloGithubDefaultConfig = `tools: org: YOUR_ORGANIZATION_NAME repo: YOUR_REPO_NAME # reference parameters come from dependency, their usage will be explained later - boardId: ${{ my-trello-board.trello.outputs.boardId }} - todoListId: ${{ my-trello-board.trello.outputs.todoListId }} - doingListId: ${{ my-trello-board.trello.outputs.doingListId }} - doneListId: ${{ my-trello-board.trello.outputs.doneListId }} + boardId: ${{ TRELLO_TOOL_NAME.trello.outputs.boardId }} + todoListId: ${{ TRELLO_TOOL_NAME.trello.outputs.todoListId }} + doingListId: ${{ TRELLO_TOOL_NAME.trello.outputs.doingListId }} + doneListId: ${{ TRELLO_TOOL_NAME.trello.outputs.doneListId }} # main branch of the repo (to which branch the plugin will submit the workflows) branch: main` diff --git a/internal/pkg/show/config/plugin/trello.go b/internal/pkg/show/config/plugin/trello.go index 34f942bba..4cddb2be2 100644 --- a/internal/pkg/show/config/plugin/trello.go +++ b/internal/pkg/show/config/plugin/trello.go @@ -4,7 +4,9 @@ var TrelloDefaultConfig = `tools: - name: my-trello-board # name of the plugin plugin: trello - # options for the plugin, checkout the version from the GitHub releases + # optional; if specified, dtm will make sure the dependency is applied first before handling this tool + dependsOn: [ "TOOL1_NAME.TOOL1_PLUGIN", "TOOL2_NAME.TOOL2_PLUGIN" ] + # options for the plugin options: # the repo's owner owner: YOUR_GITHUB_USERNAME From 4fe9acae1df2a20ff48f6779e28480c672f6043a Mon Sep 17 00:00:00 2001 From: Daniel Hu Date: Fri, 15 Apr 2022 12:11:36 +0800 Subject: [PATCH 2/2] chore: adding the trello config at trello-github-integ doc Signed-off-by: Daniel Hu --- docs/plugins/trello-github-integ.md | 56 ++++++++++++++++++----------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/docs/plugins/trello-github-integ.md b/docs/plugins/trello-github-integ.md index 77afca580..a8cc39e32 100644 --- a/docs/plugins/trello-github-integ.md +++ b/docs/plugins/trello-github-integ.md @@ -9,26 +9,42 @@ This plugin depends on and can be used together with the `trello` plugin (see do `trello-github-integ` plugin can also use `trello` plugin's outputs as input. See the example below: ```yaml -- name: trello-github - # name of the plugin - plugin: trello-github-integ - # optional; if specified, dtm will make sure the dependency is applied first before handling this tool. - dependsOn: [ "TRELLO_TOOL_NAME.trello" ] - # options for the plugin - options: - # the repo's owner. It should be case-sensitive here; strictly use your GitHub user name; please change the value below. - owner: YOUR_GITHUB_USERNAME - # the repo where you'd like to setup GitHub Actions; please change the value below. - # the repo's org. If you set this property, then the new repo will be created under the org you're given, and the "owner" setting above will be ignored. - org: YOUR_ORGANIZATION_NAME - repo: YOUR_REPO_NAME - # reference parameters come from dependency, their usage will be explained later - boardId: ${{ TRELLO_TOOL_NAME.trello.outputs.boardId }} - todoListId: ${{ TRELLO_TOOL_NAME.trello.outputs.todoListId }} - doingListId: ${{ TRELLO_TOOL_NAME.trello.outputs.doingListId }} - doneListId: ${{ TRELLO_TOOL_NAME.trello.outputs.doneListId }} - # main branch of the repo (to which branch the plugin will submit the workflows) - branch: main +tools: + - name: my-trello-board + # name of the plugin + plugin: trello + # optional; if specified, dtm will make sure the dependency is applied first before handling this tool + dependsOn: [ "TOOL1_NAME.TOOL1_PLUGIN", "TOOL2_NAME.TOOL2_PLUGIN" ] + # options for the plugin + options: + # the repo's owner + owner: YOUR_GITHUB_USERNAME + # the repo's org. If you set this property, then the new repo will be created under the org you're given, and the "owner" setting above will be ignored. + org: YOUR_ORGANIZATION_NAME + # for which repo this board will be used + repo: YOUR_REPO_NAME + # the Tello board name. If empty, use owner/repo as the board's name. + kanbanBoardName: KANBAN_BOARD_NAME + - name: trello-github + # name of the plugin + plugin: trello-github-integ + # optional; if specified, dtm will make sure the dependency is applied first before handling this tool. + dependsOn: [ "TRELLO_TOOL_NAME.trello" ] + # options for the plugin + options: + # the repo's owner. It should be case-sensitive here; strictly use your GitHub user name; please change the value below. + owner: YOUR_GITHUB_USERNAME + # the repo where you'd like to setup GitHub Actions; please change the value below. + # the repo's org. If you set this property, then the new repo will be created under the org you're given, and the "owner" setting above will be ignored. + org: YOUR_ORGANIZATION_NAME + repo: YOUR_REPO_NAME + # reference parameters come from dependency, their usage will be explained later + boardId: ${{ TRELLO_TOOL_NAME.trello.outputs.boardId }} + todoListId: ${{ TRELLO_TOOL_NAME.trello.outputs.todoListId }} + doingListId: ${{ TRELLO_TOOL_NAME.trello.outputs.doingListId }} + doneListId: ${{ TRELLO_TOOL_NAME.trello.outputs.doneListId }} + # main branch of the repo (to which branch the plugin will submit the workflows) + branch: main ``` Replace the following from the config above: