runservice: set default config task working_dir
Set default task working_dir to ~/project
This commit is contained in:
parent
4c30a5af1c
commit
ebe34ba1fa
@ -33,6 +33,8 @@ const (
|
|||||||
maxRunNameLength = 100
|
maxRunNameLength = 100
|
||||||
maxTaskNameLength = 100
|
maxTaskNameLength = 100
|
||||||
maxStepNameLength = 100
|
maxStepNameLength = 100
|
||||||
|
|
||||||
|
defaultWorkingDir = "~/project"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ConfigFormat int
|
type ConfigFormat int
|
||||||
@ -760,7 +762,12 @@ func checkConfig(config *Config) error {
|
|||||||
// Set defaults
|
// Set defaults
|
||||||
for _, run := range config.Runs {
|
for _, run := range config.Runs {
|
||||||
for _, task := range run.Tasks {
|
for _, task := range run.Tasks {
|
||||||
// Set auth type to default if not specified
|
// set task default working dir
|
||||||
|
if task.WorkingDir == "" {
|
||||||
|
task.WorkingDir = defaultWorkingDir
|
||||||
|
}
|
||||||
|
|
||||||
|
// set auth type to default if not specified
|
||||||
runtime := task.Runtime
|
runtime := task.Runtime
|
||||||
if runtime.Auth != nil {
|
if runtime.Auth != nil {
|
||||||
if runtime.Auth.Type == "" {
|
if runtime.Auth.Type == "" {
|
||||||
|
@ -266,7 +266,7 @@ func TestParseOutput(t *testing.T) {
|
|||||||
"ENV01": Value{Type: ValueTypeString, Value: "ENV01"},
|
"ENV01": Value{Type: ValueTypeString, Value: "ENV01"},
|
||||||
"ENVFROMVARIABLE01": Value{Type: ValueTypeFromVariable, Value: "variable01"},
|
"ENVFROMVARIABLE01": Value{Type: ValueTypeFromVariable, Value: "variable01"},
|
||||||
},
|
},
|
||||||
WorkingDir: "",
|
WorkingDir: defaultWorkingDir,
|
||||||
Shell: "",
|
Shell: "",
|
||||||
User: "",
|
User: "",
|
||||||
Steps: []interface{}{
|
Steps: []interface{}{
|
||||||
@ -374,7 +374,7 @@ func TestParseOutput(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
WorkingDir: "",
|
WorkingDir: defaultWorkingDir,
|
||||||
Steps: []interface{}{},
|
Steps: []interface{}{},
|
||||||
Depends: []*Depend{},
|
Depends: []*Depend{},
|
||||||
},
|
},
|
||||||
@ -389,7 +389,7 @@ func TestParseOutput(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
WorkingDir: "",
|
WorkingDir: defaultWorkingDir,
|
||||||
Steps: []interface{}{},
|
Steps: []interface{}{},
|
||||||
Depends: []*Depend{},
|
Depends: []*Depend{},
|
||||||
},
|
},
|
||||||
@ -404,7 +404,7 @@ func TestParseOutput(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
WorkingDir: "",
|
WorkingDir: defaultWorkingDir,
|
||||||
Steps: []interface{}{},
|
Steps: []interface{}{},
|
||||||
Depends: []*Depend{},
|
Depends: []*Depend{},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user