Compare commits

...

2 Commits

Author SHA1 Message Date
45c9d5afcb
Stop brew updating everything all the time
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-01-21 18:26:04 +00:00
09a3059378
Added standup/teardown helpers
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-01-21 18:25:02 +00:00
3 changed files with 178 additions and 0 deletions

88
home/.bin/gs-standup Executable file
View File

@ -0,0 +1,88 @@
#!/usr/bin/env bash
source .utils
CODE_DIR="${HOME}/Code/GiantSwarm/cluster-test-suites"
print_usage() {
orange "gs-standup - Standup a new test workload cluster, using the cluster-test-suites modules."
echo " "
underline "Usage:"
echo "gs-standup [provider]"
echo " "
underline "Examples:"
echo "> gs-standup capa"
echo "> gs-standup eks"
echo " "
underline "Options:"
echo "-h, --help show this help text"
echo " --dir override the directory of cluster-test-suite code"
}
POS_ARGS=()
while test $# -gt 0; do
case "$1" in
-h|--help)
print_usage
exit 0
;;
--dir)
shift
CODE_DIR=$1
shift
;;
*)
POS_ARGS+=(`echo $1 | tr '/' ' '`)
shift
;;
esac
done
case ${#POS_ARGS[@]} in
0)
print_usage
exit 1
;;
1)
PROVIDER=""
CONTEXT=""
case ${POS_ARGS[0]} in
"aws"|"capa")
PROVIDER="aws"
CONTEXT="capa"
;;
"azure"|"capz")
PROVIDER="azure"
CONTEXT="capz"
;;
"vsphere"|"capv")
PROVIDER="vsphere"
CONTEXT="capv"
;;
"cloud-director"|"capvcd")
PROVIDER="cloud-director"
CONTEXT="capvcd"
;;
"eks")
PROVIDER="eks"
CONTEXT="eks"
;;
"aws-private"|"capa-private")
PROVIDER="aws"
CONTEXT="capa-private-proxy"
;;
esac
go run ${CODE_DIR}/cmd/standup/main.go \
--provider ${PROVIDER} \
--context ${CONTEXT} \
--cluster-values ${CODE_DIR}/providers/${CONTEXT}/standard/test_data/cluster_values.yaml \
--default-apps-values ${CODE_DIR}/providers/${CONTEXT}/standard/test_data/default-apps_values.yaml
;;
*)
print_usage
exit 1
;;
esac

87
home/.bin/gs-teardown Executable file
View File

@ -0,0 +1,87 @@
#!/usr/bin/env bash
source .utils
CODE_DIR="${HOME}/Code/GiantSwarm/cluster-test-suites"
print_usage() {
orange "gs-teardown - Teardown a previously created test cluster"
echo " "
underline "Usage:"
echo "gs-teardown [provider]"
echo " "
underline "Examples:"
echo "> gs-teardown capa"
echo "> gs-teardown eks"
echo " "
underline "Options:"
echo "-h, --help show this help text"
echo " --dir override the directory of cluster-test-suite code"
}
POS_ARGS=()
while test $# -gt 0; do
case "$1" in
-h|--help)
print_usage
exit 0
;;
--dir)
shift
CODE_DIR=$1
shift
;;
*)
POS_ARGS+=(`echo $1 | tr '/' ' '`)
shift
;;
esac
done
case ${#POS_ARGS[@]} in
0)
print_usage
exit 1
;;
1)
PROVIDER=""
CONTEXT=""
case ${POS_ARGS[0]} in
"aws"|"capa")
PROVIDER="aws"
CONTEXT="capa"
;;
"azure"|"capz")
PROVIDER="azure"
CONTEXT="capz"
;;
"vsphere"|"capv")
PROVIDER="vsphere"
CONTEXT="capv"
;;
"cloud-director"|"capvcd")
PROVIDER="cloud-director"
CONTEXT="capvcd"
;;
"eks")
PROVIDER="eks"
CONTEXT="eks"
;;
"aws-private"|"capa-private")
PROVIDER="aws"
CONTEXT="capa-private-proxy"
;;
esac
go run ${CODE_DIR}/cmd/teardown/main.go \
--provider ${PROVIDER} \
--context ${CONTEXT} \
--standup-directory ./
;;
*)
print_usage
exit 1
;;
esac

View File

@ -31,3 +31,6 @@ export TZ_LIST="Europe/Berlin;Europe/Sofia;UTC"
# Docker
export DOCKER_HOST=$(docker context inspect --format='{{.Endpoints.docker.Host}}')
# Brew - Prevent updating all packages when installing a new one
export HOMEBREW_NO_AUTO_UPDATE=1