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

Auto cleanup #1136

Merged
merged 2 commits into from
Jul 18, 2024
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
17 changes: 15 additions & 2 deletions examples/morpheusvm/scripts/deploy.devnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,23 @@ EOF

# Setup devnet
CLUSTER="vryx-$(date +%s)"

interrupted=false
function showcleanup {
if [ "$interrupted" = false ]; then
echo -e "\n\n${RED}run this command to destroy the devnet:${NC} ${TMPDIR}/avalanche node destroy ${CLUSTER}\n"
fi
}

function cleanup {
echo -e "\n\n${RED}run this command to destroy the devnet:${NC} ${TMPDIR}/avalanche node destroy ${CLUSTER}\n"
interrupted=true
echo -e "\n\n${RED}destroying the devnet, running:${NC} ${TMPDIR}/avalanche node destroy ${CLUSTER}\n"
${TMPDIR}/avalanche node destroy ${CLUSTER} -y
}
trap cleanup EXIT

trap showcleanup EXIT
trap cleanup SIGINT

# List of supported instances in each AWS region: https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-instance-regions.html
#
# It is not recommended to use an instance with burstable network performance.
Expand Down
Loading