- Go 94.5%
- Dockerfile 5.5%
|
|
||
|---|---|---|
| .woodpecker | ||
| internal | ||
| workflows | ||
| .gitignore | ||
| .goreleaser.yaml | ||
| .markdownlint.json | ||
| .prettierrc | ||
| .trivyignore | ||
| Containerfile | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| main.go | ||
| README.md | ||
| renovate.json | ||
Woodpecker Configuration Server
Woodpecker CI has an ability to use a server as external configuration server, see in document. This application start an endpoint that can receive signal from Woodpecker server and respond accordingly.
Structure of workflows
My repositories are organized with a unique suffix, for example:
foo.goapp: This is an application written in Gofoo.gopack: Package for Go projectfoo.woodpecker: Woodpecker CI configuration
The workflows can be found in the workflows directory. Each directory is checked as suffix. The directory contains further directories which are events. And those directories contains the workflows.
Settings
The CLI settings and their environment variable pairs can be found in config file.
var CLIParameters struct {
Serve struct {
Port int `short:"p" env:"APP_SERVE_PORT" default:"5000" help:"Listen port"`
Hostname string `short:"H" env:"APP_SERVE_HOSTNAME" default:"0.0.0.0" help:"Address or host that port is binded"`
WoodpeckerURL string ` env:"APP_SERVE_WP_URL" help:"Address of woodpecker CI"`
} `cmd:"" help:"Start and listen server"`
List struct {
Suffix string `short:"s" env:"APP_LIST_SUFFIX" help:"List action within suffix"`
Action string `short:"a" env:"APP_LIST_ACTION" help:"List workflows within suffix.action"`
Workflow string `short:"w" env:"APP_LIST_WORKFLOW" help:"Display content of suffix.action.workflow.yaml file"`
} `cmd:"" help:"List the workflows"`
Version struct{} `cmd:"" help:"Version information"`
}
Usage
The simplest way is to put into the same pod, than Woodpecker server, and they
can communicate via 127.0.0.1.
[Unit]
Description=Woodpecker CI configuration server
StartLimitBurst=5
StartLimitIntervalSec=90
[Container]
Exec=serve
Image=code.thinkaboutit.tech/pandora/woodpecker-config-server.goapp:latest
Pod=wood.pod
Environment="APP_SERVE_WP_URL=http://127.0.0.1:8000"
Environment="PLUGIN_DEBUG=true"
[Service]
Restart=on-failure
RestartSec=2
[Install]
# If you want auto-start after reboot
WantedBy=default.target
In the Woodpecker Quadlet, following settings must be specified:
Environment="WOODPECKER_CONFIG_EXTENSION_ENDPOINT=http://127.0.0.1:5000/ciconfig"
Environment="WOODPECKER_EXTENSIONS_ALLOWED_HOSTS=loopback"
Note
If they are not in the same pod, then the allowed hosts might be different, check document.