Skip to content

Commit

Permalink
add uninstall script
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaquinRivesGambin committed Apr 15, 2024
1 parent 1bf9fe3 commit f665163
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions uninstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

set -eoa pipefail

SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
PLATFORM_DIR="$SCRIPT_DIR/.platform"
PLATFORM_CONFIG="$PLATFORM_DIR/.config"

# check if the platform directory exists
if [ -d "$PLATFORM_DIR" ]; then
# source the configuration file
source $PLATFORM_CONFIG
else
echo "The platform directory not found: $PLATFORM_DIR"
echo "Please run the setup.sh script first, or check the 'Manual deletion' section in the setup.md for manual deletion of the platform."
exit 1
fi

# Delete the cluster
kind delete cluster --name $CLUSTER_NAME

if [ "$INSTALL_LOCAL_REGISTRY" = "true" ]; then
# Delete the local Docker registry
echo "Deleting the local Docker registry..."
docker stop kind-registry
docker rm kind-registry
echo "Local Docker registry deleted."
fi

rm -rf "$PLATFORM_DIR"

echo "The platform has been successfully uninstalled."
exit 0

0 comments on commit f665163

Please sign in to comment.