about summary refs log tree commit diff
path: root/webdeploy.mk
blob: 23603233faa1f8b0137e062af9d4fe8058a9917d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
SRC_DIR ?= .
DEPLOY_HOST ?=
DEPLOY_DIR ?= /var/www/

webdeploy:
	@ 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 "make gen" >> .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