서비스 태그를 하위 버전에도 붙여줌

This commit is contained in:
2023-07-03 14:12:21 +09:00
parent 7a5696961f
commit d1a192159b

View File

@ -45,12 +45,13 @@ func (h *houstonHandler) GetDeploySources(w http.ResponseWriter, r *http.Request
getVersions := func(name string) []string { getVersions := func(name string) []string {
var out []string var out []string
vers, _ := os.ReadDir(path.Join(h.deployPath, name)) vers, _ := os.ReadDir(path.Join(h.deployPath, name))
mytags, _ := os.ReadFile(path.Join(h.deployPath, name, "@tags"))
for _, fd := range vers { for _, fd := range vers {
if fd.IsDir() { if fd.IsDir() {
ver := fd.Name() ver := fd.Name()
files, _ := os.ReadDir(path.Join(h.deployPath, name, ver)) files, _ := os.ReadDir(path.Join(h.deployPath, name, ver))
vertags, _ := os.ReadFile(path.Join(h.deployPath, name, ver, "@tags")) vertags, _ := os.ReadFile(path.Join(h.deployPath, name, ver, "@tags"))
ver = ver + string(vertags) ver = ver + string(mytags) + string(vertags)
if len(files) > 0 { if len(files) > 0 {
for _, file := range files { for _, file := range files {
@ -66,10 +67,7 @@ func (h *houstonHandler) GetDeploySources(w http.ResponseWriter, r *http.Request
out = append(out, ver) out = append(out, ver)
} }
} }
mytags, _ := os.ReadFile(path.Join(h.deployPath, name, "@tags"))
if len(mytags) > 0 {
out = append(out, string(mytags))
}
return out return out
} }