Introduce `delete-elasticsearch` scripts for both Windows and Unix to stop, remove containers, and delete data volumes. Updated `Makefile` to include this command for easier management. Upgraded `django-elasticsearch-dsl` and related dependencies to their latest versions for compatibility. Breaking change: Updated Elasticsearch image and configuration to enable xpack security. Ensure environment variables are properly set.
24 lines
853 B
Bash
24 lines
853 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
source ./scripts/Unix/starter.sh
|
|
|
|
# Stop the elasticsearch container
|
|
log_step "Stopping Elasticsearch container..."
|
|
if ! docker compose stop elasticsearch; then
|
|
log_warning "Elasticsearch container may not be running"
|
|
fi
|
|
log_success "Elasticsearch container stopped!"
|
|
|
|
# Remove the elasticsearch container
|
|
log_step "Removing Elasticsearch container..."
|
|
docker compose rm -f elasticsearch || log_warning "Failed to remove Elasticsearch container"
|
|
log_success "Elasticsearch container removed!"
|
|
|
|
# Remove the es-data volume
|
|
log_step "Removing Elasticsearch data volume..."
|
|
docker volume rm -f schon_es-data || log_warning "Failed to remove es-data volume (may not exist)"
|
|
log_success "Elasticsearch data volume removed!"
|
|
|
|
echo
|
|
log_result "Elasticsearch has been wiped. Run 'make restart' to recreate and reindex."
|