diff --git a/install/preview/entrypoint.sh b/install/preview/entrypoint.sh index 75440f6c65bad6..7fbcc4b4977289 100755 --- a/install/preview/entrypoint.sh +++ b/install/preview/entrypoint.sh @@ -30,6 +30,7 @@ fi if [ -z "${DOMAIN}" ]; then DOMAIN="127-0-0-1.nip.io" fi +export DOMAIN echo "Gitpod Domain: $DOMAIN" diff --git a/install/preview/prettylog/main.go b/install/preview/prettylog/main.go index 26f31e7f81fb1d..18f015a6f7eb5d 100644 --- a/install/preview/prettylog/main.go +++ b/install/preview/prettylog/main.go @@ -6,6 +6,7 @@ package main import ( "bufio" "errors" + "fmt" "io" "os" "strings" @@ -13,21 +14,28 @@ import ( "github.com/pterm/pterm" ) -var msgs = []struct { - Fail string - Success string +var ( + Domain = "127-0-0-1.nip.io" + msgs = []struct { + Fail string + Success string - Msg string -}{ - {Msg: "checking prerequisites", Fail: "requires a system with at least", Success: "Gitpod Domain:"}, - {Msg: "preparing system", Success: "extracting images to download ahead"}, - {Msg: "downloading images", Success: "--output-split-files"}, - {Msg: "preparing Gitpod preview installation", Success: "rm -rf /var/lib/rancher/k3s/server/manifests/gitpod"}, - {Msg: "starting Gitpod", Success: "gitpod-telemetry-init"}, - {Msg: "Gitpod is running"}, -} + Msg string + }{ + {Msg: "checking prerequisites", Fail: "requires a system with at least", Success: "Gitpod Domain:"}, + {Msg: "preparing system", Success: "extracting images to download ahead"}, + {Msg: "downloading images", Success: "--output-split-files"}, + {Msg: "preparing Gitpod preview installation", Success: "rm -rf /var/lib/rancher/k3s/server/manifests/gitpod"}, + {Msg: "starting Gitpod", Success: "gitpod-telemetry-init"}, + {Msg: fmt.Sprintf("Gitpod is running. Visit https://%s to access the dashboard", Domain)}, + } +) func main() { + if domain := os.Getenv("DOMAIN"); domain != "" { + Domain = domain + } + dmp, err := os.OpenFile("logs.txt", os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0644) if err != nil { panic(err)