Correct sync location and split up steps

This commit is contained in:
Chris Thompson 2019-01-24 13:46:35 -05:00
parent dd58eb1c24
commit fbd90e84b8

View file

@ -1,5 +1,5 @@
# Identify tasks which do not have output files: # Identify tasks which do not have output files:
.PHONY: help synclivetotest .PHONY: help synclivetotest syncdb syncfiles
GREEN := $(shell tput -Txterm setaf 2) GREEN := $(shell tput -Txterm setaf 2)
WHITE := $(shell tput -Txterm setaf 7) WHITE := $(shell tput -Txterm setaf 7)
@ -29,13 +29,17 @@ 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.dev
SRV := elizabeth.mayfirst.org SRV := root@elizabeth.mayfirst.org
FILES_LIVE := /home/agaric_live/files FILES_LIVE := /home/agaric_live/files/
FILES_TEST := /home/agaric_test/files FILES_TEST := /home/agaric_test/files
ECHO := $(if $(TEST),@echo) ECHO := $(if $(TEST),@echo)
synclivetotest: ##@Targets Sync live environment to test synclivetotest: syncfiles syncdb ##@Targets Sync live environment to test
syncdb:
$(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)
syncfiles:
$(ECHO) ssh -A $(SRV) rsync -rz --stats --exclude styles \ $(ECHO) ssh -A $(SRV) rsync -rz --stats --exclude styles \
--exclude css --exclude js $(FILES_LIVE) \ --exclude css --exclude js $(FILES_LIVE) \
--delete ${FILES_TEST} --delete ${FILES_TEST}