Skip to content

Commit

Permalink
fix: display collapse when using sd-local (#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
wahapo authored Mar 22, 2021
1 parent db2ebed commit 7a6a69d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.local
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@ VOLUME /opt/sd
VOLUME /hab

# Set Entrypoint
ENTRYPOINT ["/opt/sd/launcher_entrypoint.sh"]
ENTRYPOINT ["/opt/sd/launcher_entrypoint.sh"]
32 changes: 21 additions & 11 deletions launch.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ var readFile = ioutil.ReadFile
var newEmitter = screwdriver.NewEmitter
var marshal = json.Marshal
var unmarshal = json.Unmarshal
var cyanFprintf = color.New(color.FgCyan).Add(color.Underline).FprintfFunc()
var blackSprint = color.New(color.FgHiBlack).SprintFunc()
var cyanSprint = color.New(color.FgCyan).Add(color.Underline).SprintFunc()
var blackSprintf = color.New(color.FgHiBlack).SprintfFunc()
var pushgatewayUrlTimeout = 15
var buildCreateTime time.Time
var queueEnterTime time.Time
Expand Down Expand Up @@ -509,15 +509,25 @@ func launch(api screwdriver.API, buildID int, rootDir, emitterPath, metaSpace, s
sourceDir = sourceDir + "/" + scm.RootDir
}

cyanFprintf(emitter, "Screwdriver Launcher information\n")
fmt.Fprintf(emitter, "%s%s\n", blackSprint("Version: v"), version)
fmt.Fprintf(emitter, "%s%d\n", blackSprint("Pipeline: #"), job.PipelineID)
fmt.Fprintf(emitter, "%s%s\n", blackSprint("Job: "), job.Name)
fmt.Fprintf(emitter, "%s%d\n", blackSprint("Build: #"), buildID)
fmt.Fprintf(emitter, "%s%s\n", blackSprint("Workspace Dir: "), w.Root)
fmt.Fprintf(emitter, "%s%s\n", blackSprint("Checkout Dir: "), w.Src)
fmt.Fprintf(emitter, "%s%s\n", blackSprint("Source Dir: "), sourceDir)
fmt.Fprintf(emitter, "%s%s\n", blackSprint("Artifacts Dir: "), w.Artifacts)
infoMessages := []string{
cyanSprint("Screwdriver Launcher information"),
blackSprintf("Version: v%s", version),
blackSprintf("Pipeline: #%d", job.PipelineID),
blackSprintf("Job: %s", job.Name),
blackSprintf("Build: #%d", buildID),
blackSprintf("Workspace Dir: %s", w.Root),
blackSprintf("Checkout Dir: %s", w.Src),
blackSprintf("Source Dir: %s", sourceDir),
blackSprintf("Artifacts Dir: %s", w.Artifacts),
}

for _, v := range infoMessages {
if isLocal {
log.Print(v)
} else {
fmt.Fprintf(emitter, "%s\n", v)
}
}

if pr != "" {
job.Name = "main"
Expand Down

0 comments on commit 7a6a69d

Please sign in to comment.