Files
Paradise/tools/docker/zzz-destroy-everything-zzz
Patrick MeadeandGitHub 677e13353f Adds Dockerfile and Utility Scripts (#31446)
* Adds Dockerfile and Utility Scripts

* Remove RUSTG_VERSION from _build_dependencies.sh

* Moved documentation to references, added link to mkdocs.yml

* Update references, finish documentation, fix typos

* Fixed small error in docs and scripts

* Add CI action to build and publish game server images

* Bump CI action to compatible Ubuntu runner

* Fix up the base image for NanoMap rendering

* Remove commented out base for nanomap-build stage

* Removed default values from Dockerfile build arguments

Sanitized default arguments in Dockerfile
Updated CI workflow to use _build_dependencies.sh to build the Docker image
Added documentation on using --build-arg flags with the docker build command

* Modify caching for Docker builds in CI

* Add missing files to pacify Nanomap Renderer
2026-04-11 22:13:20 +00:00

54 lines
1.7 KiB
Bash
Executable File

#!/usr/bin/env bash
# zzz-destroy-everything-zzz
# Activate the Nuclear Authentication Disk
set -euo pipefail
#
# !!! This script will destroy everything !!!
#
# Your database and server containers will be stopped and deleted.
# The database volume containing all the data in your database will be deleted.
# The server image you last built will be deleted.
# The docker network the database container and server container used to talk to each other will be deleted.
# The entire secret/ directory, and the database credentials kept there, will be deleted.
# The backup file for your database will be deleted.
#
# NOTE: Destroys all of the things. !! EVERYTHING !! You have been warned!
#
BACKUP_FILE="paradise_db.sql"
DB_CONTAINER="paradise_db"
DB_VOLUME="paradise_db_data"
NETWORK_NAME="paradise_net"
SERVER_CONTAINER="paradise"
SERVER_IMAGE="paradise:latest"
ZZZ_DESTROY="honk-honk-honk"
# make sure we're at the root of the repository
if [ ! -f "Dockerfile" ]; then
echo >&2 "Error: No Dockerfile found. Are you at the repository root?"
exit 1
fi
# make sure the user actually wants to run this...
if [ "${1:-}" != "${ZZZ_DESTROY}" ]; then
echo >&2 "Error: If you *really* want to do this:"
echo >&2 ""
echo >&2 "$0 ${ZZZ_DESTROY}"
echo >&2 ""
echo >&2 "There is NO way to UNDO this! If you do this, you destroy *everything*, PERMANENTLY!"
exit 1
fi
# engaging nuclear authentication disk...
docker stop "${SERVER_CONTAINER}" || true
docker stop "${DB_CONTAINER}" || true
docker rm "${DB_CONTAINER}" || true
docker image rm "${SERVER_IMAGE}" || true
docker network rm "${NETWORK_NAME}" || true
docker volume rm "${DB_VOLUME}" || true
rm -frv secret
rm -fv "${BACKUP_FILE}"
echo "You honked my battleship!"