diff --git a/Makefile_old b/Makefile_old index 20a19bdf..7f3799cc 100644 --- a/Makefile_old +++ b/Makefile_old @@ -7,12 +7,6 @@ sync_prod_flatpages: venv_check ./manage.py loaddata data/flat.json @echo "Done." -# Sync test media directory with production -sync_test_media: - @if [ ${USER} != "mam-web" ]; then echo "Only possible by user mam-web"; exit 1; fi - @if [ `readlink -f .` != "/aux/akce/mam/www/mamweb-test" ]; then echo "Only possible in /akce/mam/www/mamweb-test"; exit 1; fi - rsync -av --delete /akce/mam/www/mamweb-prod/media/ ./media - # Sync (with drop) test database with production database sync_test_db_aggressive: @if [ ${USER} != "mam-web" ]; then echo "Only possible by user mam-web"; exit 1; fi @@ -25,6 +19,4 @@ sync_test_db_aggressive: psql mam_test -c "UPDATE django_site SET name='MaMweb (test)', domain='mam-test.ks.matfyz.cz' WHERE id=1" @echo Done. -# Sync test with production -# HACK ALERT: using aggressive variant, due to the schemas being too different. sync_test: sync_test_media sync_test_db_aggressive diff --git a/make/sync_test_media b/make/sync_test_media index e69de29b..d7991b65 100755 --- a/make/sync_test_media +++ b/make/sync_test_media @@ -0,0 +1,9 @@ +#!/bin/bash + +set -exuo pipefail +. make/lib.sh + +gimli_only +only_in_dir "$TESTWEB" + +rsync -av --delete "$PRODWEB/media/" ./media