-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlaunch_ui.sh
executable file
·54 lines (46 loc) · 1.06 KB
/
launch_ui.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
44
45
46
47
48
49
50
51
52
#!/bin/bash
#
# Shortcut script to forward the superset port and then launch the browser
# Assumes NodePort
#
# Shortcut script to forward the superset port and then launch the browser
# Tested on OSX (open url)
#
# Author: @merlos
# https://github.com/unicef/magasin-drill
# Apache 2.0 License
#
# Default namespace
NAMESPACE='magasin-drill'
# Function to display usage
function display_usage() {
echo "Usage: $0 [-n <namespace>] [-h]"
}
# Parse command-line arguments
while getopts ":n:h" opt; do
case $opt in
n)
NAMESPACE="$OPTARG"
;;
h)
display_usage
exit 0
;;
\?)
echo "Error: Invalid option -$OPTARG"
display_usage
exit 1
;;
:)
echo "Error: Option -$OPTARG requires an argument."
display_usage
exit 1
;;
esac
done
# Stop on error
set -e
echo
echo "Open a browser at http://localhost:8047"
echo
kubectl port-forward --namespace $NAMESPACE service/drill-service 8047:8047