Update file sync based on server specs and change drush alias

This commit is contained in:
Chris Thompson 2019-02-20 15:50:43 -05:00
parent 626fa03d5a
commit 20bee0fac4

View file

@ -28,14 +28,21 @@ help: ##@Targets Show this text (or just run make)
# Configure sync' # Configure sync'
ALIAS_LIVE := @live.live ALIAS_LIVE := @live.live
ALIAS_TEST := @test.dev ALIAS_TEST := @test.test
SRV := elizabeth.mayfirst.org SRV_TEST := root@elizabeth.mayfirst.org
FILES_LIVE := /home/agaric_live/files SRV_LIVE := $(SRV_TEST)
FILES_TEST := /home/agaric_test/files FILES_LIVE := /home/family_home_live/files
FILES_TEST := /home/family_home_test/files
ECHO := $(if $(TEST),@echo) ECHO := $(if $(TEST),@echo)
synclivetotest: ##@Targets Sync live environment to test synclivetotest: ##@Targets Sync live environment to test (pass TEST=true to echo commands)
$(ECHO) drush -y $(ALIAS_TEST) sql-drop $(ECHO) drush -y $(ALIAS_TEST) sql-drop
$(ECHO) drush -y sql-sync $(ALIAS_LIVE) $(ALIAS_TEST) $(ECHO) drush -y sql-sync $(ALIAS_LIVE) $(ALIAS_TEST)
$(ECHO) ssh -A $(SRV) rsync -rz --stats --exclude styles \ ifeq ($(SRV_TEST), $(SRV_LIVE))
$(ECHO) ssh -A $(SRV_LIVE) rsync -rz --stats --exclude styles \
--exclude css --exclude js $(FILES_LIVE) \ --exclude css --exclude js $(FILES_LIVE) \
--delete ${FILES_TEST} --delete ${FILES_TEST}
else
$(ECHO) drush -y sync $(ALIAS_LIVE)/public/%files $(ALIAS_TEST)/public/%files
endif