Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nasa/nos3#443] Update Uninstall Scripting #472

Merged
merged 3 commits into from
Jan 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions scripts/cfg/uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source $SCRIPT_DIR/../env.sh

echo "Cleaning up all COSMOS files..."
echo "Cleaning up any COSMOS files..."
yes | rm $BASE_DIR/gsw/cosmos/Gemfile 2> /dev/null
yes | rm $BASE_DIR/gsw/cosmos/Gemfile.lock 2> /dev/null
yes | rm -r $BASE_DIR/gsw/cosmos/COMPONENTS 2> /dev/null
Expand All @@ -15,22 +15,19 @@ yes | rm -r $BASE_DIR/gsw/cosmos/outputs 2> /dev/null
echo "Cleaning up Minicom log..."
yes | rm $BASE_DIR/minicom.cap 2> /dev/null

echo "Cleaning up CryptoLib build..."
yes | rm $BASE_DIR/minicom.cap 2> /dev/null

echo "Cleaning up local user directory..."
$DFLAGS -v $USER_NOS3_DIR:$USER_NOS3_DIR $DBOX rm -rf $USER_NOS3_DIR
if docker ps -a --format "{{.Names}}" | grep -q "^${DBOX}$"; then
rm -f "${USER_NOS3_DIR}"
fi
rm -rf $USER_NOS3_DIR/*
rm -rf $USER_FPRIME_PATH

yes | rm -rf $USER_NOS3_DIR/.m2 2> /dev/null
yes | rm -rf $USER_NOS3_DIR 2> /dev/null
echo "Removing NOS Based containers..."
yes 2> /dev/null | $DCALL images --format "{{.Repository}}:{{.Tag}}" | grep '^ivvitc' | xargs -r docker rmi

echo "Removing containers..."
$DCALL system prune -f 2> /dev/null
echo "Removing NOS Based container networks..."
yes | $DNETWORK ls --format "{{.Name}}" | grep '^nos3_' | xargs -r docker network rm 2> /dev/null

echo "Removing container networks..."
yes | docker network prune -f 2> /dev/null
yes | docker swarm leave --force 2> /dev/null
yes | $DCALL swarm leave --force 2> /dev/null

exit 0