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

@ -6,7 +6,6 @@ import (
"errors"
"fmt"
"io"
"io/fs"
"net/http"
"net/url"
"os"
@ -81,11 +80,11 @@ func unzip(fname string) error {
filePath := path.Join(verpath, name)
if f.FileInfo().IsDir() {
os.MkdirAll(filePath, os.ModePerm)
os.MkdirAll(filePath, 0775)
continue
}
if err := os.MkdirAll(path.Dir(filePath), os.ModePerm); err != nil {
if err := os.MkdirAll(path.Dir(filePath), 0775); err != nil {
return err
}
@ -133,7 +132,7 @@ func untar(fname string) error {
switch header.Typeflag {
case tar.TypeDir:
if err := os.MkdirAll(path.Join(verpath, header.Name), 0755); err != nil {
if err := os.MkdirAll(path.Join(verpath, header.Name), 0775); err != nil {
return err
}
case tar.TypeReg:
@ -171,7 +170,7 @@ func (hc *houstonClient) prepareDeploy(name string, version string) (destPath st
verpath := path.Join(name, version)
if _, err := os.Stat(verpath); os.IsNotExist(err) {
// 없네? 만들면 된다.
err = os.MkdirAll(verpath, fs.FileMode(os.O_WRONLY))
err = os.MkdirAll(verpath, 0775)
if err != nil {
return "", err
}

View File

@ -177,6 +177,8 @@ func prepareProcessLaunch(req *shared.StartProcessRequest) *procmeta {
if err == nil && fi.IsDir() {
args[0] = "./" + path.Clean(strings.TrimPrefix(args[0], "/"))
os.Chmod(path.Join(verpath, args[0]), 0777)
cmd := exec.Command(args[0], args[1:]...)
cmd.Dir = verpath
stdin, _ := cmd.StdinPipe()
@ -204,7 +206,7 @@ func (hc *houstonClient) launch(meta *procmeta) error {
return err
}
err = os.MkdirAll(path.Join(meta.cmd.Dir, "logs"), os.ModePerm)
err = os.MkdirAll(path.Join(meta.cmd.Dir, "logs"), 0775)
if err != nil {
return err
}