Skip to content

Commit 0a69e4d

Browse files
committed
Fix help messages
1 parent 735cf91 commit 0a69e4d

File tree

3 files changed

+88
-2
lines changed

3 files changed

+88
-2
lines changed

scripts/test-utils.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,15 @@
1313
if [ -z "$SCRIPT_DIR" ]; then
1414
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
1515
fi
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)
2027
ROUTER_URL=$(get_router_graphql_url | sed 's|/graphql$||')

setup-env.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,46 @@ set -e
1616
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
1717
source "$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+
1959
ENV_FILE="router/.env"
2060
TEMPLATE_FILE="router/env.example"
2161

setup-minikube.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,45 @@ set -e
66
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
77
source "$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+
948
show_script_header "Minikube Setup" "Setting up minikube for Apollo Supergraph deployment"
1049

1150
# Validate required tools

0 commit comments

Comments
 (0)