A repositoryPath

This commit is contained in:
zhenorzz 2022-01-21 10:46:11 +08:00
parent 987b2b177a
commit 28b698adb2
3 changed files with 6 additions and 0 deletions

View File

@ -20,6 +20,7 @@ type Config struct {
type APPConfig struct { type APPConfig struct {
DeployLimit int32 `toml:"deployLimit"` DeployLimit int32 `toml:"deployLimit"`
ShutdownTimeout time.Duration `toml:"shutdownTimeout"` ShutdownTimeout time.Duration `toml:"shutdownTimeout"`
RepositoryPath string `toml:"repositoryPath"`
} }
type CookieConfig struct { type CookieConfig struct {

View File

@ -1,6 +1,7 @@
package core package core
import ( import (
"github.com/zhenorzz/goploy/config"
"os" "os"
"os/exec" "os/exec"
"path" "path"
@ -55,6 +56,9 @@ func GetConfigFile() string {
} }
func GetRepositoryPath() string { func GetRepositoryPath() string {
if config.Toml.APP.RepositoryPath != "" {
return path.Join(config.Toml.APP.RepositoryPath, "repository")
}
return path.Join(GetAssetDir(), "repository") return path.Join(GetAssetDir(), "repository")
} }

View File

@ -2,6 +2,7 @@ env = 'production'
[app] [app]
deployLimit = 8 deployLimit = 8
shutdownTimeout = 10 shutdownTimeout = 10
repositoryPath = ''
[cookie] [cookie]
name = 'goploy_token' name = 'goploy_token'