Skip to content

Commit 3995a3d

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 3995a3d

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

install/preview/prettylog/main.go

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,36 @@ 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+
var (
18+
Domain = "127-0-0-1.nip.io"
19+
msgs = []struct {
20+
Fail string
21+
Success string
1922

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

3034
func main() {
35+
if domain := os.Getenv("DOMAIN"); domain != "" {
36+
Domain = domain
37+
}
38+
3139
dmp, err := os.OpenFile("logs.txt", os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0644)
3240
if err != nil {
3341
panic(err)

0 commit comments

Comments
 (0)