From fbd90e84b86113780b9c88050e8cc82a6c72f88c Mon Sep 17 00:00:00 2001 From: Chris Thompson Date: Thu, 24 Jan 2019 13:46:35 -0500 Subject: [PATCH] Correct sync location and split up steps --- Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index b4d30c2..ba44b6d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # Identify tasks which do not have output files: -.PHONY: help synclivetotest +.PHONY: help synclivetotest syncdb syncfiles GREEN := $(shell tput -Txterm setaf 2) WHITE := $(shell tput -Txterm setaf 7) @@ -29,13 +29,17 @@ 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 +SRV := root@elizabeth.mayfirst.org +FILES_LIVE := /home/agaric_live/files/ FILES_TEST := /home/agaric_test/files 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 sql-sync $(ALIAS_LIVE) $(ALIAS_TEST) + +syncfiles: $(ECHO) ssh -A $(SRV) rsync -rz --stats --exclude styles \ --exclude css --exclude js $(FILES_LIVE) \ --delete ${FILES_TEST}