Skip to content

Commit a6aa9bc

Browse files
authored
add support for loading svc from the env (#8684)
## What changed? Allows the service the server binary starts to be controls by the `TEMPORAL_SERVICES` environment variable. ## Why? Allows us to remove the shell scripts from the server docker image. **Breaking Change**: the script currently supports `:` as a list separator but this does not ## Testing ``` === Single environment variable value === + API_KEY=from-env ./flagtest Resolved api-key: [from-env] (1 values) === Multiple comma-separated values in ENV === + API_KEY=key1,key2,key3 ./flagtest Resolved api-key: [key1 key2 key3] (3 values) === Multiple comma-separated values in CLI arg === + ./flagtest --api-key=cli1,cli2,cli3 Resolved api-key: [cli1 cli2 cli3] (3 values) === CLI argument overrides ENV variable (single values) === + API_KEY=from-env ./flagtest --api-key=from-cli Resolved api-key: [from-cli] (1 values) === Multiple --api-key arguments === + ./flagtest --api-key=first --api-key=second --api-key=third Resolved api-key: [first second third] (3 values) === Mixed: multiple args with comma-separated values === + ./flagtest --api-key=a1,a2 --api-key=b1,b2 Resolved api-key: [a1 a2 b1 b2] (4 values) ```
1 parent 93e43e5 commit a6aa9bc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cmd/server/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ func buildCLI() *cli.App {
138138
Aliases: []string{"svc"},
139139
Value: cli.NewStringSlice(temporal.DefaultServices...),
140140
Usage: "service(s) to start",
141+
EnvVars: []string{"TEMPORAL_SERVICES"},
141142
},
142143
},
143144
Before: func(c *cli.Context) error {

0 commit comments

Comments
 (0)