Skip to content

Commit 3eddded

Browse files
daniel-hutaosteinliber
authored andcommitted
docs: update yaml files to new config format
Signed-off-by: Daniel Hu <tao.hu@merico.dev>
1 parent c037545 commit 3eddded

6 files changed

Lines changed: 50 additions & 81 deletions

File tree

examples/gitops.yaml

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,20 @@
1-
---
2-
# core config
3-
varFile: "" # If not empty, use the specified external variables config file
4-
toolFile: "" # If not empty, use the specified external tools config file
5-
state: # state config, backend can be local, s3 or k8s
6-
backend: local
7-
options:
8-
stateFile: devstream.state
1+
config:
2+
state: # state config, backend can be local, s3 or k8s
3+
backend: local
4+
options:
5+
stateFile: devstream.state
96

10-
---
11-
# variables config
12-
defaultBranch: main
13-
githubUsername: daniel-hutao
14-
repoName: dtm-test-go
15-
jiraID: merico
16-
jiraUserEmail: tao.hu@merico.dev
17-
jiraProjectKey: DT
18-
dockerhubUsername: exploitht
19-
argocdNameSpace: argocd
20-
argocdDeployTimeout: 10m
7+
vars:
8+
defaultBranch: main
9+
githubUsername: daniel-hutao
10+
repoName: dtm-test-go
11+
jiraID: merico
12+
jiraUserEmail: tao.hu@merico.dev
13+
jiraProjectKey: DT
14+
dockerhubUsername: exploitht
15+
argocdNameSpace: argocd
16+
argocdDeployTimeout: 10m
2117

22-
---
23-
# plugins config
2418
tools:
2519
- name: repo-scaffolding
2620
instanceID: golang-github

examples/quickstart.yaml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
---
2-
# core config
3-
varFile: "" # If not empty, use the specified external variables config file
4-
toolFile: "" # If not empty, use the specified external tools config file
5-
state: # state config, backend can be local, s3 or k8s
6-
backend: local
7-
options:
8-
stateFile: devstream.state
1+
config:
2+
state: # state config, backend can be local, s3 or k8s
3+
backend: local
4+
options:
5+
stateFile: devstream.state
96

10-
---
11-
# plugins config
127
tools:
138
- name: repo-scaffolding
149
instanceID: golang-github

internal/pkg/configmanager/configmanager.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package configmanager
22

33
import (
4-
"errors"
5-
"io"
64
"os"
75
"regexp"
86

@@ -66,7 +64,7 @@ func (m *Manager) getConfigFromFile() (*Config, error) {
6664
configBytesEscaped := escapeBrackets(configBytes)
6765

6866
var c Config
69-
if err = yaml.Unmarshal(configBytesEscaped, &c); err != nil && !errors.Is(err, io.EOF) {
67+
if err = yaml.Unmarshal(configBytesEscaped, &c); err != nil {
7068
log.Errorf("Please verify the format of your config. Error: %s.", err)
7169
return nil, err
7270
}
Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1-
# defaultconfig.yaml sample:
2-
# var file path, you can set it to absolute path or relative path.
3-
varFile: variables.yaml # here is a relative path. (defaults is ./variables.yaml)
4-
# tool file path, you can set it to absolute path or relative path.
5-
toolFile: tools.yaml # here is a relative path.
6-
pluginDir: "" # If empty, use the default value: ~/.devstream/plugins, or use -d flag to specify a directory
7-
# state config
8-
state:
9-
backend: local # backend can be local or s3
10-
options:
11-
stateFile: devstream.state
1+
config:
2+
state:
3+
backend: local # backend can be local or s3
4+
options:
5+
stateFile: devstream.state
6+
7+
vars:
8+
githubUsername: daniel-hutao
9+
repo: go-webapp-demo
1210

13-
# tools.yaml sample:
1411
tools:
1512
- name: repo-scaffolding
1613
instanceID: default
@@ -25,7 +22,3 @@ tools:
2522
org: devstream-io
2623
repo: dtm-scaffolding-golang
2724
repoType: github
28-
29-
# variables.yaml sample:
30-
githubUsername: daniel-hutao
31-
repo: go-webapp-demo

internal/pkg/show/config/templates/gitops.yaml

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,20 @@
1-
---
2-
# core config
3-
varFile: "" # If not empty, use the specified external variables config file
4-
toolFile: "" # If not empty, use the specified external tools config file
5-
state: # state config, backend can be local, s3 or k8s
6-
backend: local
7-
options:
8-
stateFile: devstream.state
1+
config:
2+
state: # state config, backend can be local, s3 or k8s
3+
backend: local
4+
options:
5+
stateFile: devstream.state
96

10-
---
11-
# variables config
12-
defaultBranch: main
13-
githubUsername: daniel-hutao
14-
repoName: dtm-test-go
15-
jiraID: merico
16-
jiraUserEmail: tao.hu@merico.dev
17-
jiraProjectKey: DT
18-
dockerhubUsername: exploitht
19-
argocdNameSpace: argocd
20-
argocdDeployTimeout: 10m
7+
vars:
8+
defaultBranch: main
9+
githubUsername: daniel-hutao
10+
repoName: dtm-test-go
11+
jiraID: merico
12+
jiraUserEmail: tao.hu@merico.dev
13+
jiraProjectKey: DT
14+
dockerhubUsername: exploitht
15+
argocdNameSpace: argocd
16+
argocdDeployTimeout: 10m
2117

22-
---
23-
# plugins config
2418
tools:
2519
- name: repo-scaffolding
2620
instanceID: golang-github

internal/pkg/show/config/templates/quickstart.yaml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
---
2-
# core config
3-
varFile: "" # If not empty, use the specified external variables config file
4-
toolFile: "" # If not empty, use the specified external tools config file
5-
state: # state config, backend can be local, s3 or k8s
6-
backend: local
7-
options:
8-
stateFile: devstream.state
1+
config:
2+
state: # state config, backend can be local, s3 or k8s
3+
backend: local
4+
options:
5+
stateFile: devstream.state
96

10-
---
11-
# plugins config
127
tools:
138
- name: repo-scaffolding
149
instanceID: golang-github

0 commit comments

Comments
 (0)