You've already forked woodpecker
mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-11-23 21:44:44 +02:00
Various enhancements in configuration (#1645)
- backends: move to cli flags instead of os.Getenv - ssh: support 2fa with key and password - allow to set grpc jwt secret (solves todo) - allow to set default and max timeout (solves todo) Closes https://github.com/woodpecker-ci/woodpecker/issues/896 Closes https://github.com/woodpecker-ci/woodpecker/issues/1131
This commit is contained in:
@@ -30,20 +30,20 @@ func Init(ctx context.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
func FindEngine(engineName string) (types.Engine, error) {
|
||||
func FindEngine(ctx context.Context, engineName string) (types.Engine, error) {
|
||||
if engineName == "auto-detect" {
|
||||
for _, engine := range engines {
|
||||
if engine.IsAvailable() {
|
||||
if engine.IsAvailable(ctx) {
|
||||
return engine, nil
|
||||
}
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf("Can't detect an available backend engine")
|
||||
return nil, fmt.Errorf("can't detect an available backend engine")
|
||||
}
|
||||
|
||||
engine, ok := enginesByName[engineName]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("Backend engine '%s' not found", engineName)
|
||||
return nil, fmt.Errorf("backend engine '%s' not found", engineName)
|
||||
}
|
||||
|
||||
return engine, nil
|
||||
|
||||
Reference in New Issue
Block a user