File tree Expand file tree Collapse file tree 3 files changed +88
-2
lines changed Expand file tree Collapse file tree 3 files changed +88
-2
lines changed Original file line number Diff line number Diff line change 1313if [ -z " $SCRIPT_DIR " ]; then
1414 SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
1515fi
16- source " $SCRIPT_DIR /utils.sh"
17- source " $SCRIPT_DIR /config.sh"
16+
17+ # If SCRIPT_DIR is the root directory, we need to source from scripts subdirectory
18+ if [ " $( basename " $SCRIPT_DIR " ) " = " scripts" ]; then
19+ source " $SCRIPT_DIR /utils.sh"
20+ source " $SCRIPT_DIR /config.sh"
21+ else
22+ source " $SCRIPT_DIR /scripts/utils.sh"
23+ source " $SCRIPT_DIR /scripts/config.sh"
24+ fi
1825
1926# Default values (now from config)
2027ROUTER_URL=$( get_router_graphql_url | sed ' s|/graphql$||' )
Original file line number Diff line number Diff line change @@ -16,6 +16,46 @@ set -e
1616SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
1717source " $SCRIPT_DIR /scripts/utils.sh"
1818
19+ # Help function
20+ show_help () {
21+ cat << EOF
22+ Usage: $0 [OPTIONS]
23+
24+ Setup Apollo Studio environment for the Apollo Router.
25+
26+ OPTIONS:
27+ -h, --help Show this help message and exit
28+
29+ EXAMPLES:
30+ $0 # Setup environment with default settings
31+ $0 --help # Show this help message
32+
33+ DESCRIPTION:
34+ This script sets up the Apollo Studio environment by:
35+ - Creating router/.env from router/env.example template
36+ - Providing instructions for getting Apollo Studio credentials
37+ - Only creates the file if it doesn't already exist
38+
39+ After setup, you'll need to add your actual Apollo Studio credentials
40+ to the router/.env file.
41+
42+ EOF
43+ exit 0
44+ }
45+
46+ # Parse command line arguments
47+ while [[ $# -gt 0 ]]; do
48+ case $1 in
49+ -h|--help)
50+ show_help
51+ ;;
52+ * )
53+ echo " Unknown option: $1 "
54+ show_help
55+ ;;
56+ esac
57+ done
58+
1959ENV_FILE=" router/.env"
2060TEMPLATE_FILE=" router/env.example"
2161
Original file line number Diff line number Diff line change 66SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
77source " $SCRIPT_DIR /scripts/utils.sh"
88
9+ # Help function
10+ show_help () {
11+ cat << EOF
12+ Usage: $0 [OPTIONS]
13+
14+ Setup minikube for Apollo Supergraph deployment.
15+
16+ OPTIONS:
17+ -h, --help Show this help message and exit
18+
19+ EXAMPLES:
20+ $0 # Setup minikube with default settings
21+ $0 --help # Show this help message
22+
23+ DESCRIPTION:
24+ This script sets up a minikube cluster with:
25+ - 4GB memory, 2 CPUs, 20GB disk
26+ - Ingress controller enabled
27+ - Metrics server enabled
28+
29+ After setup, you can run ./run-k8s.sh to deploy the supergraph.
30+
31+ EOF
32+ exit 0
33+ }
34+
35+ # Parse command line arguments
36+ while [[ $# -gt 0 ]]; do
37+ case $1 in
38+ -h|--help)
39+ show_help
40+ ;;
41+ * )
42+ echo " Unknown option: $1 "
43+ show_help
44+ ;;
45+ esac
46+ done
47+
948show_script_header " Minikube Setup" " Setting up minikube for Apollo Supergraph deployment"
1049
1150# Validate required tools
You can’t perform that action at this time.
0 commit comments