finally fixed userdata
All checks were successful
Pipeline was successful

This commit is contained in:
Tobias Trabelsi 2023-11-06 20:55:30 +01:00
parent fe3a28f84b
commit 98d48f006f
Signed by: lerentis
GPG Key ID: FF0C2839718CAF2E

View File

@ -29,7 +29,7 @@ write_files:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
environment: environment:
{{- range $key, $val := .EnvConfig }} {{- range $key, $val := .EnvConfig }}
- {{ $key }}="{{ $val }}" - {{ $key }}={{ $val }}
{{- end }} {{- end }}
path: /root/docker-compose.yml path: /root/docker-compose.yml
runcmd: runcmd:
@ -43,11 +43,11 @@ type UserDataConfig struct {
func generateConfig(cfg *config.Config, name string) (string, error) { func generateConfig(cfg *config.Config, name string) (string, error) {
envConfig := map[string]interface{}{ envConfig := map[string]interface{}{
"WOODPECKER_SERVER": cfg.WoodpeckerGrpc, "WOODPECKER_SERVER": fmt.Sprintf(`"%s"`, cfg.WoodpeckerGrpc),
"WOODPECKER_GRPC_SECURE": true, "WOODPECKER_GRPC_SECURE": true,
"WOODPECKER_AGENT_SECRET": cfg.WoodpeckerAgentSecret, "WOODPECKER_AGENT_SECRET": fmt.Sprintf(`"%s"`, cfg.WoodpeckerAgentSecret),
"WOODPECKER_FILTER_LABELS": cfg.WoodpeckerLabelSelector, "WOODPECKER_FILTER_LABELS": fmt.Sprintf(`"%s"`, cfg.WoodpeckerLabelSelector),
"WOODPECKER_HOSTNAME": name, "WOODPECKER_HOSTNAME": fmt.Sprintf(`"%s"`, name),
} }
config := UserDataConfig{ config := UserDataConfig{
Image: "woodpeckerci/woodpecker-agent:latest", Image: "woodpeckerci/woodpecker-agent:latest",