dev
This commit is contained in:
parent
2b22041ed8
commit
a893f6ac86
|
@ -55,26 +55,40 @@ func etcExecute(ls []LocalServices) {
|
|||
for _, service := range ls {
|
||||
yamlUrl := fmt.Sprintf("%s%s/%s/%s_%s.yaml", service.Srv.OssUrl, service.Srv.EtcPath, env.MeshEnv.Workspace, service.Srv.ServiceKey, env.MeshEnv.RuntimeMode)
|
||||
body, err := utils.HttpGet(yamlUrl)
|
||||
checkError(err)
|
||||
if err != nil {
|
||||
fmt.Println("Check YAML Configure:", yamlUrl, " [ERROR]", err.Error())
|
||||
} else {
|
||||
fmt.Println("Check YAML Configure:", yamlUrl, " [OK]")
|
||||
yamlPath := filepath.Join(env.MeshEnv.Prefix, service.Srv.EtcPath, fmt.Sprintf("%s_%s.yaml", service.Srv.ServiceKey, env.MeshEnv.RuntimeMode))
|
||||
utils.StringToFile(yamlPath, string(body))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func getLocalServices() []LocalServices {
|
||||
reles := getRegistryReleases()
|
||||
|
||||
dirFs, err := os.ReadDir(env.MeshEnv.Prefix)
|
||||
checkError(err)
|
||||
|
||||
ls := make([]LocalServices, 0)
|
||||
for _, v := range dirFs {
|
||||
version := getCurrentVersion(v.Name())
|
||||
|
||||
checkError(err)
|
||||
|
||||
for _, v := range reles.Data {
|
||||
var check bool = false
|
||||
for _, srv := range dirFs {
|
||||
if v.ServiceKey == srv.Name() {
|
||||
check = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if check {
|
||||
version := getCurrentVersion(v.ServiceKey)
|
||||
if version != " - " {
|
||||
for _, srv := range reles.Data {
|
||||
|
||||
ls = append(ls, LocalServices{
|
||||
Srv: srv,
|
||||
Srv: v,
|
||||
LocalVersion: version,
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue