-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
33 lines (25 loc) · 986 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Variables
now := $(shell date +%F)
# Get working directory
work_dir := $(shell pwd)
webdir := "web/"
docdir := "web/doc"
perms:
chmod 0755 web
chmod 0755 logs
find web -type d | xargs chmod 0755
find web -type f | xargs chmod 0644
publish: perms
rsync -ar --delete --chown=root:root web/ [email protected]:/var/www/www.homebox.space/
rsync -ar --delete --chown=root:root web/ [email protected]:/var/www/homebox.space/
rsync -ar --delete --chown=root:root web/ [email protected]:/var/www/default
# preview the site in a docker instance, used for local development.
.PHONY: preview-start preview-stop preview-restart
preview-restart: preview-stop preview-start
preview-start: perms
docker build -t homebox-site .
docker run -d -v ${work_dir}/web/:/usr/share/nginx/html:ro \
--mount type=bind,source=${work_dir}/logs,target=/var/log/nginx \
-p 8005:80 homebox-site
preview-stop:
docker stop `docker ps -a -q --filter ancestor=homebox-site`