From 5cfadf9236890bcfc418f1b9af6aa223d7e1d1d1 Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Tue, 15 Nov 2022 12:05:12 +0100 Subject: [PATCH] =?UTF-8?q?Make:=20p=C5=99esunuty=20sync=5Ftest=5Fmedia?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Taky jsem smazal nějaké komentáře v Makefile_old, aby nepřekážely. --- Makefile_old | 8 -------- make/sync_test_media | 9 +++++++++ 2 files changed, 9 insertions(+), 8 deletions(-) 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