feat(cmd/joj3): trigger old conf on new stages empty
All checks were successful
build / build (push) Successful in 1m5s
build / trigger-build-image (push) Has been skipped
build / build (pull_request) Successful in 1m5s
build / trigger-build-image (pull_request) Has been skipped

This commit is contained in:
张泊明518370910136 2024-10-12 01:18:25 -04:00
parent 40fc67a60d
commit 459d1bf53d
GPG Key ID: D47306D7062CDA9D

View File

@ -160,22 +160,24 @@ func parseConfFile(path string) (conf Conf, err error) {
return
}
// TODO: remove the following backward compatibility codes
conf.Stage.SandboxExecServer = conf.SandboxExecServer
conf.Stage.SandboxToken = conf.SandboxToken
conf.Stage.OutputPath = conf.OutputPath
conf.Stage.Stages = make([]ConfStage, len(conf.Stages))
for i, stage := range conf.Stages {
conf.Stage.Stages[i].Name = stage.Name
conf.Stage.Stages[i].Group = stage.Group
conf.Stage.Stages[i].Executor = stage.Executor
conf.Stage.Stages[i].Parsers = []struct {
Name string
With interface{}
}{
{
Name: stage.Parser.Name,
With: stage.Parser.With,
},
if len(conf.Stage.Stages) == 0 {
conf.Stage.SandboxExecServer = conf.SandboxExecServer
conf.Stage.SandboxToken = conf.SandboxToken
conf.Stage.OutputPath = conf.OutputPath
conf.Stage.Stages = make([]ConfStage, len(conf.Stages))
for i, stage := range conf.Stages {
conf.Stage.Stages[i].Name = stage.Name
conf.Stage.Stages[i].Group = stage.Group
conf.Stage.Stages[i].Executor = stage.Executor
conf.Stage.Stages[i].Parsers = []struct {
Name string
With interface{}
}{
{
Name: stage.Parser.Name,
With: stage.Parser.With,
},
}
}
}
return