Pridana synchronizace lokalniho vyvoje s atreyem.
Pridany tri nove cile: sync_db: stahne posledni zalohu produkcni databaze a nahraje ji do lokalniho postgresu sync_media: stahne slozku /media bez CACHE a galerii do lokalniho /media sync: Udela sync_media a sync_db
This commit is contained in:
parent
cc93b29dc6
commit
06fd3c7d90
1 changed files with 13 additions and 0 deletions
13
Makefile
13
Makefile
|
@ -93,3 +93,16 @@ deploy_prod:
|
||||||
touch mamweb/wsgi.py
|
touch mamweb/wsgi.py
|
||||||
@echo Done.
|
@echo Done.
|
||||||
|
|
||||||
|
# Sync media directory with atrey. Useful for local development with production database
|
||||||
|
# Does not sync Galerie and CACHE (too huge).
|
||||||
|
sync_media:
|
||||||
|
rsync -ave ssh --exclude Galerie --exclude CACHE\
|
||||||
|
atrey.karlin.mff.cuni.cz:/akce/MaM/WWW/mamweb-prod/media/ ./media/
|
||||||
|
# Downloads and restores production database to local database. PostgreSQL only.
|
||||||
|
sync_db:
|
||||||
|
scp atrey.karlin.mff.cuni.cz:`ssh atrey.karlin.mff.cuni.cz 'ls -v /akce/MaM/WWW/backups/mam-prod-*\.pgdump | tail -n 1'` \
|
||||||
|
./last.pgdump
|
||||||
|
pg_restore -c -d mam -U mam last.pgdump
|
||||||
|
|
||||||
|
# Sync database and media. See above lines
|
||||||
|
sync: sync_media sync_db
|
||||||
|
|
Loading…
Reference in a new issue