2024-06-13 17:31:54 +00:00
|
|
|
# Custom backends
|
|
|
|
|
2025-01-18 19:39:06 +00:00
|
|
|
If none of our backends fits your usecase, you can write your own.
|
2024-06-13 17:31:54 +00:00
|
|
|
|
|
|
|
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 (
|
2025-01-18 19:39:06 +00:00
|
|
|
"go.woodpecker-ci.org/woodpecker/v3/cmd/agent/core"
|
|
|
|
backendTypes "go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/types"
|
2024-06-13 17:31:54 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
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.
|