You've already forked woodpecker
							
							
				mirror of
				https://github.com/woodpecker-ci/woodpecker.git
				synced 2025-10-30 23:27:39 +02:00 
			
		
		
		
	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:
		| @@ -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{} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user