-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhugo.mk
32 lines (26 loc) · 943 Bytes
/
hugo.mk
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
# VERSION=1.0.0
# Override this variable in your Makefile to use a different hugo
# version than the default on staging / production. For example:
# HUGO=/usr/local/bin/hugo-0.19
HUGO ?= /usr/local/bin/hugo-0.47.1
S3CMD ?= s3cmd
PUBLIC ?= public
DRAFT_FLAGS ?= --buildDrafts --verboseLog=true -v
PROD_FLAGS ?= -s .
S3_FLAGS ?= --acl-public --delete-removed --no-progress --no-mime-magic --guess-mime-type
INTERMEDIATE_STEPS ?= echo nothing
runserver:
$(HUGO) $(DRAFT_FLAGS) \
&& $(INTERMEDIATE_STEPS) \
&& $(HUGO) server --watch $(DRAFT_FLAGS)
deploy-stage:
rm -rf $(PUBLIC)/*
$(HUGO) $(PROD_FLAGS) -b '$(STAGING_URL)' \
&& $(INTERMEDIATE_STEPS) \
&& $(S3CMD) $(S3_FLAGS) sync $(PUBLIC)/* s3://$(STAGING_BUCKET)/
deploy-prod:
rm -rf $(PUBLIC)/*
$(HUGO) $(PROD_FLAGS) -b '$(PROD_URL)' \
&& $(INTERMEDIATE_STEPS) \
&& $(S3CMD) $(S3_FLAGS) sync $(PUBLIC)/* s3://$(PROD_BUCKET)/
.PHONY: runserver deploy-stage deploy-prod build