-
Notifications
You must be signed in to change notification settings - Fork 4
/
blackbird.sh
executable file
·43 lines (33 loc) · 1.09 KB
/
blackbird.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
UNAME=$(uname)
if [ "$UNAME" != "Linux" -a "$UNAME" != "Darwin" ] ; then
echo "Sorry, Blackbird is not supported on this OS."
echo "For more details on supported platforms, see https://www.datawire.io."
exit 1
fi
# Check if service exists
SERVICE=$(kubectl get service ambassador -n datawire)
if [[ $SERVICE = *"NotFound"* ]]; then
echo "Your deployment was not configured successfully."
echo "Please double-check the installation, or open an issue at https://github.com/datawire/blackbird/"
exit 1
fi
# Get IP on GKE
HOST=$(kubectl get service ambassador -n datawire --output jsonpath='{.status.loadBalancer.ingress[0].ip}')
# Not GKE; try AWS
if [ -z "$HOST" ] ; then
HOST=$(kubectl get service ambassador -n datawire --output jsonpath='{.status.loadBalancer.ingress[0].hostname}')
fi
# TODO: support minikube
# Docker / Kubernetes
if [ -z "$HOST" ] ; then
HOST="localhost"
fi
AMBASSADORURL="http://${HOST}"
if [ "$UNAME" = "Darwin" ] ; then
open $AMBASSADORURL
else
xdg-open $AMBASSADORURL
fi
# Minikube
# AMBASSADORURL=$(minikube service --url ambassador)