Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak server start-up text #624

Merged
merged 4 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion temporalcli/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ func Execute(ctx context.Context, options CommandOptions) {
}

func (c *TemporalCommand) initCommand(cctx *CommandContext) {
c.Command.Version = fmt.Sprintf("%s (server %s) (ui %s)", Version, headers.ServerVersion, version.UIVersion)
c.Command.Version = VersionString()
// Unfortunately color is a global option, so we can set in pre-run but we
// must unset in post-run
origNoColor := color.NoColor
Expand Down Expand Up @@ -394,6 +394,10 @@ func (c *TemporalCommand) initCommand(cctx *CommandContext) {
}
}

func VersionString() string {
return fmt.Sprintf("%s (Server %s, UI %s)", Version, headers.ServerVersion, version.UIVersion)
}

func (c *TemporalCommand) preRun(cctx *CommandContext) error {
// Configure logger if not already on context
if cctx.Logger == nil {
Expand Down
7 changes: 4 additions & 3 deletions temporalcli/commands.server.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,12 @@ func (t *TemporalServerStartDevCommand) run(cctx *CommandContext, args []string)
return err
}

cctx.Printer.Printlnf("%-16s %v:%v", "Temporal server:", toFriendlyIp(opts.FrontendIP), opts.FrontendPort)
cctx.Printer.Printlnf("CLI %v\n", VersionString())
cctx.Printer.Printlnf("%-8s %v:%v", "Server:", toFriendlyIp(opts.FrontendIP), opts.FrontendPort)
if !t.Headless {
cctx.Printer.Printlnf("%-16s http://%v:%v", "Web UI:", toFriendlyIp(opts.UIIP), opts.UIPort)
cctx.Printer.Printlnf("%-8s http://%v:%v", "UI:", toFriendlyIp(opts.UIIP), opts.UIPort)
}
cctx.Printer.Printlnf("%-16s http://%v:%v/metrics", "Metrics:", toFriendlyIp(opts.FrontendIP), opts.MetricsPort)
cctx.Printer.Printlnf("%-8s http://%v:%v/metrics", "Metrics:", toFriendlyIp(opts.FrontendIP), opts.MetricsPort)
<-cctx.Done()
cctx.Printer.Println("Stopping server...")
return nil
Expand Down
Loading