Fix --services flag format (#841)

This commit is contained in:
Alex Shtin
2020-10-13 12:53:04 -07:00
committed by GitHub
parent 316ff28233
commit 7ccbf60951
4 changed files with 15 additions and 5 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ COPY docker/start.sh /start.sh
WORKDIR /etc/temporal
ENV SERVICES="history,matching,frontend,worker"
ENV SERVICES="--services=history --services=matching --services=frontend --services=worker"
EXPOSE 6933 6934 6935 6939 7233 7234 7235 7239
ENTRYPOINT ["/docker-entrypoint.sh"]
+11 -1
View File
@@ -28,6 +28,7 @@ import (
"fmt"
"os"
"path"
"strings"
"github.com/urfave/cli"
@@ -95,7 +96,7 @@ func buildCLI() *cli.App {
zone := c.GlobalString("zone")
configDir := path.Join(c.GlobalString("root"), c.GlobalString("config"))
services := c.StringSlice("services")
services := splitServices(c.StringSlice("services"))
s := temporal.NewServer(
temporal.ForServices(services),
@@ -114,3 +115,12 @@ func buildCLI() *cli.App {
}
return app
}
// For backward compatiblity to support old flag format (i.e. `--services=frontend,history,matching`).
func splitServices(services []string) []string {
var result []string
for _, service := range services {
result = append(result, strings.Split(service, ",")...)
}
return result
}
+1 -1
View File
@@ -4,4 +4,4 @@ set -ex
dockerize -template /etc/temporal/config/config_template.yaml:/etc/temporal/config/docker.yaml
exec temporal-server --root $TEMPORAL_HOME --env docker start --services=$SERVICES
exec temporal-server --root $TEMPORAL_HOME --env docker start $SERVICES
+2 -2
View File
@@ -21,7 +21,7 @@ make install-schema
### Start temporal server
```
cd $GOPATH/github.com/temporalio/temporal
./temporal-server start --services=frontend,matching,history,worker
./temporal-server start
```
## MySQL
@@ -40,7 +40,7 @@ make install-schema-mysql
```
cd $GOPATH/github.com/temporalio/temporal
cp config/development_mysql.yaml config/development.yaml
./temporal-server start --services=frontend,matching,history,worker
./temporal-server start
```
# Config