diff --git a/.gitignore b/.gitignore index 769c710af..c5f50a46e 100644 --- a/.gitignore +++ b/.gitignore @@ -27,7 +27,6 @@ docs/build # YAML for testings config*.yaml* -app*.yaml variables*.yaml variables*.yaml.bak tools*.yaml diff --git a/cmd/devstream/show.go b/cmd/devstream/show.go index 1ecbb1008..0ef7e4851 100644 --- a/cmd/devstream/show.go +++ b/cmd/devstream/show.go @@ -26,7 +26,8 @@ var showConfigCMD = &cobra.Command{ Examples: dtm show config --plugin=A-PLUGIN-NAME, dtm show config --template=quickstart, - dtm show config --template=gitops`, + dtm show config --template=gitops, + dtm show config --template=apps`, Run: showConfigCMDFunc, } diff --git a/examples/apps.yaml b/examples/apps.yaml new file mode 100644 index 000000000..f0bfc7359 --- /dev/null +++ b/examples/apps.yaml @@ -0,0 +1,45 @@ +config: + state: + backend: local + options: + stateFile: devstream.state + +vars: + GITHUB_USER: YOUR_GITHUB_USER + DOCKERHUB_USER: YOUR_DOCKERHUB_USER + +tools: +- name: helm-installer + instanceID: argocd + +apps: +- name: myapp1 + spec: + language: python + framework: django + repo: + url: github.com/[[ GITHUB_USER ]]/myapp1 + repoTemplate: + url: github.com/devstream-io/dtm-repo-scaffolding-python-flask + ci: + - type: github-actions + options: + imageRepo: + user: [[ DOCKERHUB_USER ]] + cd: + - type: argocdapp +- name: myapp2 + spec: + language: golang + framework: gin + repo: + url: github.com/[[ GITHUB_USER ]]/myapp2 + repoTemplate: + url: github.com/devstream-io/dtm-repo-scaffolding-golang-gin + ci: + - type: github-actions + options: + imageRepo: + user: [[ DOCKERHUB_USER ]] + cd: + - type: argocdapp diff --git a/internal/pkg/show/config/config.go b/internal/pkg/show/config/config.go index c2e860bbc..128d3fd44 100644 --- a/internal/pkg/show/config/config.go +++ b/internal/pkg/show/config/config.go @@ -9,6 +9,7 @@ import ( var templates = map[string]string{ "quickstart": QuickStart, "gitops": GitOps, + "apps": Apps, } //go:generate go run gen_embed_var.go diff --git a/internal/pkg/show/config/embed_gen.go b/internal/pkg/show/config/embed_gen.go index 0da05bd90..44db1ba89 100644 --- a/internal/pkg/show/config/embed_gen.go +++ b/internal/pkg/show/config/embed_gen.go @@ -82,3 +82,6 @@ var QuickStart string //go:embed templates/gitops.yaml var GitOps string + +//go:embed templates/apps.yaml +var Apps string diff --git a/internal/pkg/show/config/gen_embed.tpl b/internal/pkg/show/config/gen_embed.tpl index c107561f1..81756b654 100644 --- a/internal/pkg/show/config/gen_embed.tpl +++ b/internal/pkg/show/config/gen_embed.tpl @@ -25,3 +25,6 @@ var QuickStart string //go:embed templates/gitops.yaml var GitOps string + +//go:embed templates/apps.yaml +var Apps string diff --git a/internal/pkg/show/config/templates/apps.yaml b/internal/pkg/show/config/templates/apps.yaml new file mode 100644 index 000000000..f0bfc7359 --- /dev/null +++ b/internal/pkg/show/config/templates/apps.yaml @@ -0,0 +1,45 @@ +config: + state: + backend: local + options: + stateFile: devstream.state + +vars: + GITHUB_USER: YOUR_GITHUB_USER + DOCKERHUB_USER: YOUR_DOCKERHUB_USER + +tools: +- name: helm-installer + instanceID: argocd + +apps: +- name: myapp1 + spec: + language: python + framework: django + repo: + url: github.com/[[ GITHUB_USER ]]/myapp1 + repoTemplate: + url: github.com/devstream-io/dtm-repo-scaffolding-python-flask + ci: + - type: github-actions + options: + imageRepo: + user: [[ DOCKERHUB_USER ]] + cd: + - type: argocdapp +- name: myapp2 + spec: + language: golang + framework: gin + repo: + url: github.com/[[ GITHUB_USER ]]/myapp2 + repoTemplate: + url: github.com/devstream-io/dtm-repo-scaffolding-golang-gin + ci: + - type: github-actions + options: + imageRepo: + user: [[ DOCKERHUB_USER ]] + cd: + - type: argocdapp