Add server env var to specify .drone.yml location
Allow setting DRONE_REPO_CONFIG to override default location of .drone.yml
This commit is contained in:
parent
538f256834
commit
820d07263b
3 changed files with 9 additions and 1 deletions
|
@ -93,6 +93,12 @@ var flags = []cli.Flag{
|
||||||
Name: "open",
|
Name: "open",
|
||||||
Usage: "open user registration",
|
Usage: "open user registration",
|
||||||
},
|
},
|
||||||
|
cli.StringFlag{
|
||||||
|
EnvVar: "DRONE_REPO_CONFIG",
|
||||||
|
Name: "repo-config",
|
||||||
|
Usage: "file path for the drone config",
|
||||||
|
Value: ".drone.yml",
|
||||||
|
},
|
||||||
cli.DurationFlag{
|
cli.DurationFlag{
|
||||||
EnvVar: "DRONE_SESSION_EXPIRES",
|
EnvVar: "DRONE_SESSION_EXPIRES",
|
||||||
Name: "session-expires",
|
Name: "session-expires",
|
||||||
|
@ -639,6 +645,7 @@ func setupEvilGlobals(c *cli.Context, v store.Store, r remote.Remote) {
|
||||||
droneserver.Config.Server.Pass = c.String("agent-secret")
|
droneserver.Config.Server.Pass = c.String("agent-secret")
|
||||||
droneserver.Config.Server.Host = strings.TrimRight(c.String("server-host"), "/")
|
droneserver.Config.Server.Host = strings.TrimRight(c.String("server-host"), "/")
|
||||||
droneserver.Config.Server.Port = c.String("server-addr")
|
droneserver.Config.Server.Port = c.String("server-addr")
|
||||||
|
droneserver.Config.Server.RepoConfig = c.String("repo-config")
|
||||||
droneserver.Config.Server.SessionExpires = c.Duration("session-expires")
|
droneserver.Config.Server.SessionExpires = c.Duration("session-expires")
|
||||||
droneserver.Config.Pipeline.Networks = c.StringSlice("network")
|
droneserver.Config.Pipeline.Networks = c.StringSlice("network")
|
||||||
droneserver.Config.Pipeline.Volumes = c.StringSlice("volume")
|
droneserver.Config.Pipeline.Volumes = c.StringSlice("volume")
|
||||||
|
|
|
@ -45,7 +45,7 @@ func PostRepo(c *gin.Context) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if repo.Config == "" {
|
if repo.Config == "" {
|
||||||
repo.Config = ".drone.yml"
|
repo.Config = Config.Server.RepoConfig
|
||||||
}
|
}
|
||||||
if repo.Timeout == 0 {
|
if repo.Timeout == 0 {
|
||||||
repo.Timeout = 60 // 1 hour default build time
|
repo.Timeout = 60 // 1 hour default build time
|
||||||
|
|
|
@ -60,6 +60,7 @@ var Config = struct {
|
||||||
Host string
|
Host string
|
||||||
Port string
|
Port string
|
||||||
Pass string
|
Pass string
|
||||||
|
RepoConfig string
|
||||||
SessionExpires time.Duration
|
SessionExpires time.Duration
|
||||||
// Open bool
|
// Open bool
|
||||||
// Orgs map[string]struct{}
|
// Orgs map[string]struct{}
|
||||||
|
|
Loading…
Reference in a new issue