Skip to content

Instantly share code, notes, and snippets.

@rummelonp
Last active August 6, 2021 22:06
Show Gist options
  • Save rummelonp/38fe2a32c9f6c5d95434426ea168df8e to your computer and use it in GitHub Desktop.
Save rummelonp/38fe2a32c9f6c5d95434426ea168df8e to your computer and use it in GitHub Desktop.
make で雑にデプロイするやつ
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