houston server config에 storagepath 추가

This commit is contained in:
2023-06-13 10:10:30 +09:00
parent b14ad791df
commit 5c00ff73d7
6 changed files with 43 additions and 25 deletions

View File

@ -29,7 +29,7 @@ func (h *houstonHandler) GetDeploySources(w http.ResponseWriter, r *http.Request
files, err := os.ReadDir("deploys")
if err != nil {
if errors.Is(err, fs.ErrNotExist) {
err = os.MkdirAll("deploys", os.ModePerm)
err = os.MkdirAll("deploys", 0775)
}
}
@ -96,7 +96,7 @@ func (h *houstonHandler) UploadDeploySource(w http.ResponseWriter, r *http.Reque
filename = path.Join("deploys", name, version, name+ext)
}
if err = os.MkdirAll(path.Dir(filename), os.ModePerm); err != nil {
if err = os.MkdirAll(path.Dir(filename), 0775); err != nil {
logger.Error(err)
w.WriteHeader(http.StatusInternalServerError)
return