Skip to content

Commit

Permalink
[local-preview] show DOMAIN in the output
Browse files Browse the repository at this point in the history
This PR updates the `local-preview` to printout
the Domain of the Gitpod Instance for users to
access.

Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
  • Loading branch information
Pothulapati committed Jul 13, 2022
1 parent 61b3df2 commit 748ff80
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
1 change: 1 addition & 0 deletions install/preview/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ fi
if [ -z "${DOMAIN}" ]; then
DOMAIN="127-0-0-1.nip.io"
fi
export DOMAIN

echo "Gitpod Domain: $DOMAIN"

Expand Down
32 changes: 20 additions & 12 deletions install/preview/prettylog/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,36 @@ package main
import (
"bufio"
"errors"
"fmt"
"io"
"os"
"strings"

"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)
Expand Down

0 comments on commit 748ff80

Please sign in to comment.