made version configurable as well and remove "" from agent config
All checks were successful
Pipeline was successful
All checks were successful
Pipeline was successful
This commit is contained in:
parent
98ec02ea0b
commit
9f90962d92
@ -17,6 +17,7 @@ type Config = struct {
|
||||
WoodpeckerGrpc string `default:"" env:"WOODPECKER_AUTOSCALER_WOODPECKER_GRPC"`
|
||||
WoodpeckerAgentSecret string `default:"" env:"WOODPECKER_AUTOSCALER_WOODPECKER_AGENT_SECRET"`
|
||||
WoodpeckerApiToken string `default:"" env:"WOODPECKER_AUTOSCALER_WOODPECKER_API_TOKEN"`
|
||||
WoodpeckerAgentVersion string `default:"latest" env:"WOODPECKER_AUTOSCALER_WOODPECKER_AGENT_VERSION"`
|
||||
HcloudToken string `default:"" env:"WOODPECKER_AUTOSCALER_HCLOUD_TOKEN"`
|
||||
HcloudInstanceType string `default:"cpx21" env:"WOODPECKER_AUTOSCALER_HCLOUD_INSTANCE_TYPE"`
|
||||
HcloudRegion string `default:"" env:"WOODPECKER_AUTOSCALER_HCLOUD_REGION"`
|
||||
|
@ -47,11 +47,11 @@ func generateConfig(cfg *config.Config, name string) (string, error) {
|
||||
"WOODPECKER_SERVER": fmt.Sprintf("%s", cfg.WoodpeckerGrpc),
|
||||
"WOODPECKER_GRPC_SECURE": true,
|
||||
"WOODPECKER_AGENT_SECRET": fmt.Sprintf("%s", cfg.WoodpeckerAgentSecret),
|
||||
"WOODPECKER_FILTER_LABELS": fmt.Sprintf(`"%s"`, cfg.WoodpeckerLabelSelector),
|
||||
"WOODPECKER_HOSTNAME": fmt.Sprintf(`"%s"`, name),
|
||||
"WOODPECKER_FILTER_LABELS": fmt.Sprintf("%s", cfg.WoodpeckerLabelSelector),
|
||||
"WOODPECKER_HOSTNAME": fmt.Sprintf("%s", name),
|
||||
}
|
||||
config := UserDataConfig{
|
||||
Image: "woodpeckerci/woodpecker-agent:latest",
|
||||
Image: fmt.Sprintf("woodpeckerci/woodpecker-agent:%s", cfg.WoodpeckerAgentVersion),
|
||||
EnvConfig: envConfig,
|
||||
}
|
||||
tmpl, err := template.New("userdata").Parse(USER_DATA_TEMPLATE)
|
||||
|
@ -16,6 +16,7 @@ func TestGenerateUserData(t *testing.T) {
|
||||
WoodpeckerGrpc: "grpc-test.woodpecker.test.tld:443",
|
||||
WoodpeckerAgentSecret: "Geheim1!",
|
||||
WoodpeckerApiToken: "VeryGeheim1!",
|
||||
WoodpeckerAgentVersion: "latest",
|
||||
HcloudToken: "EvenMoreGeheim1!",
|
||||
HcloudInstanceType: "cpx21",
|
||||
HcloudRegion: "eu-central",
|
||||
@ -37,9 +38,9 @@ write_files:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
environment:
|
||||
- WOODPECKER_AGENT_SECRET=Geheim1!
|
||||
- WOODPECKER_FILTER_LABELS="uploadfilter24.eu/instance-role=WoodpeckerTest"
|
||||
- WOODPECKER_FILTER_LABELS=uploadfilter24.eu/instance-role=WoodpeckerTest
|
||||
- WOODPECKER_GRPC_SECURE=true
|
||||
- WOODPECKER_HOSTNAME="test-instance"
|
||||
- WOODPECKER_HOSTNAME=test-instance
|
||||
- WOODPECKER_SERVER=grpc-test.woodpecker.test.tld:443
|
||||
path: /root/docker-compose.yml
|
||||
runcmd:
|
||||
|
Loading…
Reference in New Issue
Block a user