mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-04-26 13:34:45 +00:00
Allow using args in container (#4011)
This commit is contained in:
parent
b0fe208399
commit
c0b1d6aaa4
1 changed files with 7 additions and 4 deletions
|
@ -62,11 +62,14 @@ func (e *local) Name() string {
|
||||||
return "local"
|
return "local"
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *local) IsAvailable(context.Context) bool {
|
func (e *local) IsAvailable(ctx context.Context) bool {
|
||||||
|
if c, ok := ctx.Value(types.CliCommand).(*cli.Command); ok {
|
||||||
|
if c.String("backend-engine") == e.Name() {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
_, inContainer := os.LookupEnv("WOODPECKER_IN_CONTAINER")
|
_, inContainer := os.LookupEnv("WOODPECKER_IN_CONTAINER")
|
||||||
// note: we don't need to check by args as this would indicate we are not in an container anyway ...
|
return !inContainer
|
||||||
backend := os.Getenv("WOODPECKER_BACKEND")
|
|
||||||
return backend == "local" || !inContainer
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *local) Flags() []cli.Flag {
|
func (e *local) Flags() []cli.Flag {
|
||||||
|
|
Loading…
Reference in a new issue