Last active
August 6, 2021 22:06
-
-
Save rummelonp/38fe2a32c9f6c5d95434426ea168df8e to your computer and use it in GitHub Desktop.
make で雑にデプロイするやつ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SRC = $(CURDIR)/ | |
DEST = user@host:/path/to/ | |
EXCLUDES = .git config log vendor | |
OPTIONS = -razv --delete | |
EXCLUDE_OPTIONS = $(foreach path,$(EXCLUDES),--exclude=$(path)) | |
.PHONY: push push-force pull pull-force | |
all: | |
@echo Usage: make \<push\|push-force\|pull\|pull-force\> | |
push: | |
rsync --dry-run $(OPTIONS) $(EXCLUDE_OPTIONS) $(SRC) $(DEST) | |
push-force: | |
rsync $(OPTIONS) $(EXCLUDE_OPTIONS) $(SRC) $(DEST) | |
pull: | |
rsync --dry-run $(OPTIONS) $(EXCLUDE_OPTIONS) $(DEST) $(SRC) | |
pull-force: | |
rsync $(OPTIONS) $(EXCLUDE_OPTIONS) $(DEST) $(SRC) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment