mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-11 19:16:32 +00:00
24 lines
659 B
Markdown
24 lines
659 B
Markdown
|
# Custom backends
|
||
|
|
||
|
If none of our backends fits your usecases, you can write your own.
|
||
|
|
||
|
Therefore, implement the interface `"go.woodpecker-ci.org/woodpecker/woodpecker/v2/pipeline/backend/types".Backend` and
|
||
|
build a custom agent using your backend with this `main.go`:
|
||
|
|
||
|
```go
|
||
|
package main
|
||
|
|
||
|
import (
|
||
|
"go.woodpecker-ci.org/woodpecker/v2/cmd/agent/core"
|
||
|
backendTypes "go.woodpecker-ci.org/woodpecker/v2/pipeline/backend/types"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
core.RunAgent([]backendTypes.Backend{
|
||
|
yourBackend,
|
||
|
})
|
||
|
}
|
||
|
```
|
||
|
|
||
|
It is also possible to use multiple backends, you can select with [`WOODPECKER_BACKEND`](../15-agent-config.md#woodpecker_backend) between them.
|