Implements Validation of Dependencies

This commit is contained in:
2024-10-20 22:30:31 -03:00
parent f712973df9
commit e1350f0812

View File

@@ -1,6 +1,33 @@
#!/bin/sh
validate_dependencies() {
if ! command -v kubectl &> /dev/null; then
echo "kubectl could not be found"
exit 1
fi
if ! command -v helm &> /dev/null; then
echo "helm could not be found"
exit 1
fi
if ! command -v envsubst &> /dev/null; then
echo "envsubst could not be found"
exit 1
fi
if [[ $environment == "local" ]]; then
if ! command -v minikube &> /dev/null; then
echo "minikube could not be found"
exit 1
fi
fi
echo "Dependencies validated"
}
read_env_file() {
if [ -f $1 ]; then
set -a && source $1 && set +a;
@@ -204,6 +231,8 @@ while getopts ":f:e:mrh" opt; do
esac
done
validate_dependencies
if [[ $execution_mode == "deploy" ]]; then
main
elif [[ $execution_mode == "refresh" ]]; then