Update file sync based on server specs and change drush alias
This commit is contained in:
parent
626fa03d5a
commit
20bee0fac4
1 changed files with 15 additions and 8 deletions
23
Makefile
23
Makefile
|
@ -28,14 +28,21 @@ help: ##@Targets Show this text (or just run make)
|
|||
|
||||
# Configure sync'
|
||||
ALIAS_LIVE := @live.live
|
||||
ALIAS_TEST := @test.dev
|
||||
SRV := elizabeth.mayfirst.org
|
||||
FILES_LIVE := /home/agaric_live/files
|
||||
FILES_TEST := /home/agaric_test/files
|
||||
ALIAS_TEST := @test.test
|
||||
SRV_TEST := root@elizabeth.mayfirst.org
|
||||
SRV_LIVE := $(SRV_TEST)
|
||||
FILES_LIVE := /home/family_home_live/files
|
||||
FILES_TEST := /home/family_home_test/files
|
||||
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 sql-sync $(ALIAS_LIVE) $(ALIAS_TEST)
|
||||
$(ECHO) ssh -A $(SRV) rsync -rz --stats --exclude styles \
|
||||
--exclude css --exclude js $(FILES_LIVE) \
|
||||
--delete ${FILES_TEST}
|
||||
ifeq ($(SRV_TEST), $(SRV_LIVE))
|
||||
$(ECHO) ssh -A $(SRV_LIVE) rsync -rz --stats --exclude styles \
|
||||
--exclude css --exclude js $(FILES_LIVE) \
|
||||
--delete ${FILES_TEST}
|
||||
else
|
||||
$(ECHO) drush -y sync $(ALIAS_LIVE)/public/%files $(ALIAS_TEST)/public/%files
|
||||
endif
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue