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