blob: 3e7557cc2af5ab72eea3560736f4d8d63cc5fab5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
SRC_DIR ?= .
DEPLOY_HOST ?=
DEPLOY_DIR ?= /var/www/
webdeploy:
@ test -n "${SRC_DIR}"
@ ssh $(DEPLOY_HOST) test -n "${DEPLOY_DIR}"
rsync -vhhh --delete -Ccrzl $(SRC_DIR)/ $(DEPLOY_HOST):$(DEPLOY_DIR)/
webdeploy-test:
@ ${MAKE} webdeploy DEPLOY_DIR=${DEPLOY_DIR_test}
webdeploy-live:
@ ${MAKE} webdeploy DEPLOY_DIR=${DEPLOY_DIR_live}
webdeploy-register-hook:
@ echo '#!/bin/sh' > .git/hooks/pre-push
@ echo '[ $1 != origin ] && exit 0' >> .git/hooks/pre-push
@ echo 'makesgen' >> .git/hooks/pre-push
@ echo 'make webdeploy-live' >> .git/hooks/pre-push
@ echo 'exit 0' >> .git/hooks/pre-push
.PHONY: webdeploy webdeploy-test webdeploy-live webdeploy-register-hook
|