Skip to content

Commit 457a8d7

Browse files
committed
feat: add apps template to dtm show config
Signed-off-by: Tiexin Guo <[email protected]>
1 parent 617680e commit 457a8d7

File tree

7 files changed

+99
-2
lines changed

7 files changed

+99
-2
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ docs/build
2727

2828
# YAML for testings
2929
config*.yaml*
30-
app*.yaml
3130
variables*.yaml
3231
variables*.yaml.bak
3332
tools*.yaml

cmd/devstream/show.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ var showConfigCMD = &cobra.Command{
2626
Examples:
2727
dtm show config --plugin=A-PLUGIN-NAME,
2828
dtm show config --template=quickstart,
29-
dtm show config --template=gitops`,
29+
dtm show config --template=gitops,
30+
dtm show config --template=apps`,
3031
Run: showConfigCMDFunc,
3132
}
3233

examples/apps.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
config:
2+
state:
3+
backend: local
4+
options:
5+
stateFile: devstream.state
6+
7+
vars:
8+
GITHUB_USER: YOUR_GITHUB_USER
9+
DOCKERHUB_USER: YOUR_DOCKERHUB_USER
10+
11+
tools:
12+
- name: helm-installer
13+
instanceID: argocd
14+
15+
apps:
16+
- name: myapp1
17+
spec:
18+
language: python
19+
framework: django
20+
repo:
21+
url: github.com/[[ GITHUB_USER ]]/myapp1
22+
repoTemplate:
23+
url: github.com/devstream-io/dtm-repo-scaffolding-python-flask
24+
ci:
25+
- type: github-actions
26+
options:
27+
imageRepo:
28+
user: [[ DOCKERHUB_USER ]]
29+
cd:
30+
- type: argocdapp
31+
- name: myapp2
32+
spec:
33+
language: golang
34+
framework: gin
35+
repo:
36+
url: github.com/[[ GITHUB_USER ]]/myapp2
37+
repoTemplate:
38+
url: github.com/devstream-io/dtm-repo-scaffolding-golang-gin
39+
ci:
40+
- type: github-actions
41+
options:
42+
imageRepo:
43+
user: [[ DOCKERHUB_USER ]]
44+
cd:
45+
- type: argocdapp

internal/pkg/show/config/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
var templates = map[string]string{
1010
"quickstart": QuickStart,
1111
"gitops": GitOps,
12+
"apps": Apps,
1213
}
1314

1415
//go:generate go run gen_embed_var.go

internal/pkg/show/config/embed_gen.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/pkg/show/config/gen_embed.tpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ var QuickStart string
2525

2626
//go:embed templates/gitops.yaml
2727
var GitOps string
28+
29+
//go:embed templates/apps.yaml
30+
var Apps string
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
config:
2+
state:
3+
backend: local
4+
options:
5+
stateFile: devstream.state
6+
7+
vars:
8+
GITHUB_USER: YOUR_GITHUB_USER
9+
DOCKERHUB_USER: YOUR_DOCKERHUB_USER
10+
11+
tools:
12+
- name: helm-installer
13+
instanceID: argocd
14+
15+
apps:
16+
- name: myapp1
17+
spec:
18+
language: python
19+
framework: django
20+
repo:
21+
url: github.com/[[ GITHUB_USER ]]/myapp1
22+
repoTemplate:
23+
url: github.com/devstream-io/dtm-repo-scaffolding-python-flask
24+
ci:
25+
- type: github-actions
26+
options:
27+
imageRepo:
28+
user: [[ DOCKERHUB_USER ]]
29+
cd:
30+
- type: argocdapp
31+
- name: myapp2
32+
spec:
33+
language: golang
34+
framework: gin
35+
repo:
36+
url: github.com/[[ GITHUB_USER ]]/myapp2
37+
repoTemplate:
38+
url: github.com/devstream-io/dtm-repo-scaffolding-golang-gin
39+
ci:
40+
- type: github-actions
41+
options:
42+
imageRepo:
43+
user: [[ DOCKERHUB_USER ]]
44+
cd:
45+
- type: argocdapp

0 commit comments

Comments
 (0)