Files
app-organization-portal/scripts/reset-elastic.sh
mirdono eb55bc9def refactor: determine docker compose command based on system
- Determine whether to use `docker compose` or `docker-compose` based on whether
  the former is available on the system at hand.
- Use the `--remove-orphanS` flag, supported since v1.7.0, instead of its
  singular form which was removed at some point.
2025-01-29 10:20:25 +01:00

20 lines
560 B
Bash
Executable File

#!/bin/bash
version=$(docker compose version)
if [ $? -eq 0 ]; then
DRC_COMMAND="docker compose"
else
DRC_COMMAND="docker-compose"
fi
echo "warning this will run queries on the triplestore and delete containers, you have 3 seconds to press ctrl+c"
sleep 3
eval "$DRC_COMMAND rm -fs elasticsearch search"
sudo rm -rf data/elasticsearch/
eval "$DRC_COMMAND exec -T triplestore isql-v <<EOF
SPARQL DELETE WHERE { GRAPH <http://mu.semte.ch/authorization> { ?s ?p ?o. } };
exec('checkpoint');
exit;
EOF"
eval "$DRC_COMMAND up -d --remove-orphans"