Skip to content

Commit 2033d13

Browse files
committed
[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 <[email protected]>
1 parent 61b3df2 commit 2033d13

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

install/preview/entrypoint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ fi
3030
if [ -z "${DOMAIN}" ]; then
3131
DOMAIN="127-0-0-1.nip.io"
3232
fi
33+
export DOMAIN
3334

3435
echo "Gitpod Domain: $DOMAIN"
3536

install/preview/prettylog/main.go

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,33 @@ package main
66
import (
77
"bufio"
88
"errors"
9+
"fmt"
910
"io"
1011
"os"
1112
"strings"
1213

1314
"github.com/pterm/pterm"
1415
)
1516

16-
var msgs = []struct {
17-
Fail string
18-
Success string
17+
func main() {
18+
domain := "127-0-0-1.nip.io"
19+
if override := os.Getenv("DOMAIN"); override != "" {
20+
domain = override
21+
}
22+
msgs := []struct {
23+
Fail string
24+
Success string
1925

20-
Msg string
21-
}{
22-
{Msg: "checking prerequisites", Fail: "requires a system with at least", Success: "Gitpod Domain:"},
23-
{Msg: "preparing system", Success: "extracting images to download ahead"},
24-
{Msg: "downloading images", Success: "--output-split-files"},
25-
{Msg: "preparing Gitpod preview installation", Success: "rm -rf /var/lib/rancher/k3s/server/manifests/gitpod"},
26-
{Msg: "starting Gitpod", Success: "gitpod-telemetry-init"},
27-
{Msg: "Gitpod is running"},
28-
}
26+
Msg string
27+
}{
28+
{Msg: "checking prerequisites", Fail: "requires a system with at least", Success: "Gitpod Domain:"},
29+
{Msg: "preparing system", Success: "extracting images to download ahead"},
30+
{Msg: "downloading images", Success: "--output-split-files"},
31+
{Msg: "preparing Gitpod preview installation", Success: "rm -rf /var/lib/rancher/k3s/server/manifests/gitpod"},
32+
{Msg: "starting Gitpod", Success: "gitpod-telemetry-init"},
33+
{Msg: fmt.Sprintf("Gitpod is running. Visit https://%s to access the dashboard", domain)},
34+
}
2935

30-
func main() {
3136
dmp, err := os.OpenFile("logs.txt", os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0644)
3237
if err != nil {
3338
panic(err)

0 commit comments

Comments
 (0)