forked from QA-Org-123/corpus-tools
Add the per-site refresh script
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
# Restore one corpus site from its snapshot and point its URLs at the public name.
|
||||
set -e
|
||||
site=$1
|
||||
[ -n "$site" ] || { echo "usage: refresh-site.sh <site>|--all"; exit 2; }
|
||||
|
||||
if [ "$site" = "--all" ]; then
|
||||
tail -n +2 sites.csv | cut -d, -f1 | while read -r s; do sh "$0" "$s"; done
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "restoring $site"
|
||||
docker compose -p corpus stop "$site"
|
||||
gunzip -c "snapshots/$site.sql.gz" | docker compose -p corpus exec -T "${site}_db" sh -c 'mysql'
|
||||
docker compose -p corpus start "$site"
|
||||
echo "$site is back up"
|
||||
Reference in New Issue
Block a user