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 {
DeployLimit int32 `toml:"deployLimit"`
ShutdownTimeout time.Duration `toml:"shutdownTimeout"`
RepositoryPath string `toml:"repositoryPath"`
}
type CookieConfig struct {

View File

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

View File

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