diff --git a/Makefile b/Makefile index d09b315..7b8998d 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,7 @@ REMOTE_USER=$(shell pass rsyncd/mirror-${REPO_NAME}-user) REMOTE_HOST=$(shell pass rsyncd/mirror-${REPO_NAME}-host) REMOTE_PATH=${REPO_NAME} RSYNC_OPTS=-lrhvPt --delete +RSYNC_OPTS_DRY=${RSYNC_OPTS} --dry-run RSYNC_PASSWORD=$(shell pass rsyncd/mirror-${REPO_NAME}) ##@ Package @@ -39,6 +40,16 @@ push: ## Sync local repository with remote repository @echo "$(BOLD)$(GREEN)[*] $(RST)$(BOLD)Syncing local with remote repository…$(RST)" @RSYNC_PASSWORD=$(RSYNC_PASSWORD) rsync $(RSYNC_OPTS) $(REPO_PATH)/ rsync://$(REMOTE_USER)@$(REMOTE_HOST)/$(REMOTE_PATH) +.PHONY: dry-pull +dry-pull: ## Sync remote repository with local repository (dry run) + @echo "$(BOLD)$(GREEN)[*] $(RST)$(BOLD)Syncing remote with local repository…$(RST)" + @RSYNC_PASSWORD=$(RSYNC_PASSWORD) rsync $(RSYNC_OPTS_DRY) rsync://$(REMOTE_USER)@$(REMOTE_HOST)/$(REMOTE_PATH) $(REPO_PATH)/ + +.PHONY: dry-push +dry-push: ## Sync local repository with remote repository (dry run) + @echo "$(BOLD)$(GREEN)[*] $(RST)$(BOLD)Syncing local with remote repository…$(RST)" + @RSYNC_PASSWORD=$(RSYNC_PASSWORD) rsync $(RSYNC_OPTS_DRY) $(REPO_PATH)/ rsync://$(REMOTE_USER)@$(REMOTE_HOST)/$(REMOTE_PATH) + ##@ Utility .DEFAULT_GOAL = help .PHONY: help