From eefee5515a716e45471e11f1420fcd2cf6438abc Mon Sep 17 00:00:00 2001 From: Tarun Pothulapati Date: Wed, 13 Jul 2022 09:54:45 +0000 Subject: [PATCH] [local-preview] show `DOMAIN` in the output This PR updates the `local-preview` to printout the Domain of the Gitpod Instance for users to access. Signed-off-by: Tarun Pothulapati --- install/preview/entrypoint.sh | 10 +++++----- install/preview/prettylog/main.go | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/install/preview/entrypoint.sh b/install/preview/entrypoint.sh index 75440f6c65bad6..0da8d764941d31 100755 --- a/install/preview/entrypoint.sh +++ b/install/preview/entrypoint.sh @@ -4,6 +4,11 @@ set -e +# Set Domain to `127-0-0-1.nip.io` if not set +if [ -z "${DOMAIN}" ]; then + export DOMAIN="127-0-0-1.nip.io" +fi + if [ "$1" != "logging" ]; then $0 logging 2>&1 | /prettylog exit @@ -26,11 +31,6 @@ if [ "${total_cores}" -lt "${REQUIRED_CORES}" ]; then exit 1 fi -# Set Domain to `127-0-0-1.nip.io` if not set -if [ -z "${DOMAIN}" ]; then - DOMAIN="127-0-0-1.nip.io" -fi - echo "Gitpod Domain: $DOMAIN" if [ -f /sys/fs/cgroup/cgroup.controllers ]; then diff --git a/install/preview/prettylog/main.go b/install/preview/prettylog/main.go index 26f31e7f81fb1d..cfecf8a6f3c8e4 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" @@ -24,7 +25,7 @@ var msgs = []struct { {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: fmt.Sprintf("Gitpod is running. Visit https://%s to access the dashboard", os.Getenv("DOMAIN"))}, } func main() {