This repository has been archived by the owner on Apr 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
92 lines (71 loc) · 1.67 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
.SILENT:
.PHONY: install build watch
##########
# Manala #
##########
# Hugo
HUGO_THEME = 2017
# Optimize
OPTIMIZE_IMAGES = public
include manala/make/Makefile
#########
# Setup #
#########
setup@development: install
###########
# Install #
###########
## Install
install: $(call proxy,install)
## Install - All
install@%:
# Theme
$(MAKE_HUGO_THEME) install@$*
#########
# Build #
#########
## Build
build: $(call proxy,build)
## Build - All
build@%:
# Theme
$(MAKE_HUGO_THEME) build@$*
$(call log,Hugo)
$(HUGO)
$(call log,Resize images - Thumbnails)
find public/images/posts/thumbnails \( -iname "*.png" -o -iname "*.jpg" -o -iname "*.jpeg" \) -type f | while read image; do \
printf "Resize \"$${image}\"\n" ; \
$(call mogrify_resize,$${image},400x) ; \
done
$(call log,Resize images - Headers)
find public/images/posts/headers \( -iname "*.png" -o -iname "*.jpg" -o -iname "*.jpeg" \) -type f | while read image; do \
printf "Resize \"$${image}\"\n" ; \
$(call mogrify_resize,$${image},2000x) ; \
done
#########
# Watch #
#########
## Watch
watch: $(call proxy,watch)
## Watch - Development
watch@development: SHELL = dumb-init sh
watch@development:
# Theme
$(MAKE_HUGO_THEME) watch@development & \
$(call log,Hugo - Server) && \
$(HUGO_SERVER)
##########
# Deploy #
##########
## Deploy - Staging
deploy.staging: RSYNC_RSH = $(DEPLOY_RSYNC_RSH)
deploy.staging:
$(call log,Rsync)
$(RSYNC) public/ $(DEPLOY_DESTINATION)$(if $(DEPLOY_DESTINATION_SUFFIX),/$(DEPLOY_DESTINATION_SUFFIX))
## Deploy - Production
deploy.production:
$(call log,Ansible)
ansible-playbook \
--inventory deploy/hosts.yaml \
--limit localhost,production \
deploy/playbook.yaml