client도 storageroot지원

This commit is contained in:
2023-06-14 14:16:47 +09:00
parent 46aedbe767
commit 279c9f47f0
7 changed files with 60 additions and 36 deletions

View File

@ -2,7 +2,9 @@ package server
import (
"encoding/json"
"errors"
"io"
"io/fs"
"net/http"
"os"
"path"
@ -176,12 +178,17 @@ func (h *houstonHandler) Deploy(w http.ResponseWriter, r *http.Request) {
return
}
configPath := ""
if _, err := os.Stat(path.Join(h.deployPath, name, "config", "config.json")); err == nil || errors.Is(err, fs.ErrExist) {
configPath = path.Join("deploys", name, "config", "config.json")
}
h.Operation().Deploy(MakeDeployRequest(
shared.DeployRequest{
Name: name,
Version: version,
Url: path.Join("deploys", name, version, latestFilename),
Config: path.Join("deploys", name, "config", "config.json"),
Config: configPath,
},
targets,
))
@ -338,7 +345,7 @@ func (h *houstonHandler) GetLogFileLinks(w http.ResponseWriter, r *http.Request)
}
if version == "latest" {
version, _ = shared.FindLastestVersion(path.Join(h.downloadPath, name))
version, _ = shared.FindLastestVersion(h.downloadPath, name)
}
root := path.Join(h.downloadPath, name, version)