grcp because rest is old school
All checks were successful
Pipeline was successful

This commit is contained in:
Tobias Trabelsi 2023-11-04 23:23:50 +01:00
parent e304781ba3
commit f7f7e5ffde
Signed by: lerentis
GPG Key ID: FF0C2839718CAF2E
2 changed files with 4 additions and 2 deletions

View File

@ -14,6 +14,7 @@ type Config = struct {
DryRun bool `default:"false" env:"WOODPECKER_AUTOSCALER_DRY_RUN"` DryRun bool `default:"false" env:"WOODPECKER_AUTOSCALER_DRY_RUN"`
WoodpeckerLabelSelector string `default:"uploadfilter24.eu/instance-role=Woodpecker" env:"WOODPECKER_AUTOSCALER_WOODPECKER_LABEL_SELECTOR"` WoodpeckerLabelSelector string `default:"uploadfilter24.eu/instance-role=Woodpecker" env:"WOODPECKER_AUTOSCALER_WOODPECKER_LABEL_SELECTOR"`
WoodpeckerInstance string `default:"" env:"WOODPECKER_AUTOSCALER_WOODPECKER_INSTANCE"` WoodpeckerInstance string `default:"" env:"WOODPECKER_AUTOSCALER_WOODPECKER_INSTANCE"`
WoodpeckerGrpc string `default:"" env:"WOODPECKER_AUTOSCALER_WOODPECKER_GRPC"`
WoodpeckerAgentSecret string `default:"" env:"WOODPECKER_AUTOSCALER_WOODPECKER_AGENT_SECRET"` WoodpeckerAgentSecret string `default:"" env:"WOODPECKER_AUTOSCALER_WOODPECKER_AGENT_SECRET"`
WoodpeckerApiToken string `default:"" env:"WOODPECKER_AUTOSCALER_WOODPECKER_API_TOKEN"` WoodpeckerApiToken string `default:"" env:"WOODPECKER_AUTOSCALER_WOODPECKER_API_TOKEN"`
HcloudToken string `default:"" env:"WOODPECKER_AUTOSCALER_HCLOUD_TOKEN"` HcloudToken string `default:"" env:"WOODPECKER_AUTOSCALER_HCLOUD_TOKEN"`

View File

@ -30,7 +30,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:
@ -44,7 +44,8 @@ type UserDataConfig struct {
func generateConfig(cfg *config.Config, name string) (string, error) { func generateConfig(cfg *config.Config, name string) (string, error) {
envConfig := map[string]string{} envConfig := map[string]string{}
envConfig["WOODPECKER_SERVER"] = cfg.WoodpeckerInstance envConfig["WOODPECKER_SERVER"] = cfg.WoodpeckerGrpc
envConfig["WOODPECKER_GRPC_SECURE"] = "true" // TODO: should probably made configurable
envConfig["WOODPECKER_AGENT_SECRET"] = cfg.WoodpeckerAgentSecret envConfig["WOODPECKER_AGENT_SECRET"] = cfg.WoodpeckerAgentSecret
envConfig["WOODPECKER_FILTER_LABELS"] = cfg.WoodpeckerLabelSelector envConfig["WOODPECKER_FILTER_LABELS"] = cfg.WoodpeckerLabelSelector
envConfig["WOODPECKER_HOSTNAME"] = name envConfig["WOODPECKER_HOSTNAME"] = name