Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add apps template to dtm show config #1355

Merged
merged 1 commit into from
Dec 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ docs/build

# YAML for testings
config*.yaml*
app*.yaml
variables*.yaml
variables*.yaml.bak
tools*.yaml
Expand Down
3 changes: 2 additions & 1 deletion cmd/devstream/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down
45 changes: 45 additions & 0 deletions examples/apps.yaml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions internal/pkg/show/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
var templates = map[string]string{
"quickstart": QuickStart,
"gitops": GitOps,
"apps": Apps,
}

//go:generate go run gen_embed_var.go
Expand Down
3 changes: 3 additions & 0 deletions internal/pkg/show/config/embed_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions internal/pkg/show/config/gen_embed.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ var QuickStart string

//go:embed templates/gitops.yaml
var GitOps string

//go:embed templates/apps.yaml
var Apps string
45 changes: 45 additions & 0 deletions internal/pkg/show/config/templates/apps.yaml
Original file line number Diff line number Diff line change
@@ -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