Skip to content

Commit 2846221

Browse files
committed
refactor: only show ui message in devspace dev
1 parent 60ae979 commit 2846221

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

cmd/deploy.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ type PipelineOptions struct {
233233
Pipeline string
234234
Wait bool
235235
Timeout int
236+
ShowUI bool
236237
UIPort int
237238
}
238239

@@ -294,7 +295,7 @@ func runPipeline(ctx *devspacecontext.Context, f factory.Factory, forceLeader bo
294295
pipe := pipeline.NewPipeline(ctx.Config.Config().Name, devPodManager, dependencyRegistry, configPipeline, options.Options)
295296

296297
// start ui & open
297-
serv, err := dev.UI(ctx, options.UIPort, pipe)
298+
serv, err := dev.UI(ctx, options.UIPort, options.ShowUI, pipe)
298299
if err != nil {
299300
return err
300301
}

cmd/dev.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ func (cmd *DevCmd) runCommand(ctx *devspacecontext.Context, f factory.Factory, c
192192
ConfigOptions: configOptions,
193193
Only: cmd.Dependency,
194194
Pipeline: cmd.Pipeline,
195+
ShowUI: cmd.UI,
196+
UIPort: cmd.UIPort,
195197
Wait: cmd.Wait,
196198
Timeout: cmd.Timeout,
197199
})

pkg/devspace/dev/dev.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"github.com/sirupsen/logrus"
1010
)
1111

12-
func UI(ctx *devspacecontext.Context, port int, pipeline types.Pipeline) (*server.Server, error) {
12+
func UI(ctx *devspacecontext.Context, port int, showUI bool, pipeline types.Pipeline) (*server.Server, error) {
1313
var defaultPort *int
1414
if port != 0 {
1515
defaultPort = &port
@@ -31,9 +31,11 @@ func UI(ctx *devspacecontext.Context, port int, pipeline types.Pipeline) (*serve
3131
_ = serv.Server.Close()
3232
}()
3333

34-
ctx.Log.WriteString(logrus.InfoLevel, "\n#########################################################\n")
35-
ctx.Log.Infof("DevSpace UI available at: %s", ansi.Color("http://"+serv.Server.Addr, "white+b"))
36-
ctx.Log.WriteString(logrus.InfoLevel, "#########################################################\n\n")
34+
if showUI {
35+
ctx.Log.WriteString(logrus.InfoLevel, "\n#########################################################\n")
36+
ctx.Log.Infof("DevSpace UI available at: %s", ansi.Color("http://"+serv.Server.Addr, "white+b"))
37+
ctx.Log.WriteString(logrus.InfoLevel, "#########################################################\n\n")
38+
}
3739
}
3840
return serv, nil
3941
}

0 commit comments

Comments
 (0)