This repository was archived by the owner on Sep 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (40 loc) · 2.15 KB
/
Makefile
File metadata and controls
53 lines (40 loc) · 2.15 KB
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
POST=example
BASEDIR=$(CURDIR)
INPUTDIR=$(BASEDIR)/input
OUTPUTDIR=deploy
S3_BUCKET=vfw$(POST)
DEBUG ?= 0
UID := $(shell id -u)
GID := $(shell id -g)
setup:
@echo 'Using _config.yml.$(POST)'
cp _config.yml.$(POST) _config.yml
help:
@echo 'Makefile for a Jekyll '
@echo ' '
@echo 'Usage: '
@echo ' make POST=postnumber html (re)generate the web site '
@echo ' make POST=postnumber clean remove the generated files '
@echo ' make POST=postnumber pushupdate posts deploy folder to CDN '
@echo ' make POST=postnumber publish generate using production settings '
@echo ' make POST=postnumber devserver start/restart local server '
@echo ' '
@echo 'Set the DEBUG variable to 1 to enable debugging, e.g. make DEBUG=1 html '
@echo 'Set the RELATIVE variable to 1 to enable relative urls '
@echo ' '
html: setup
docker run -e JEKYLL_UID=$(UID) -e JEKYLL_GID=$(GID) --rm -v $(BASEDIR):/srv/jekyll jekyll/jekyll jekyll build -d $(OUTPUTDIR)
clean:
[ ! -d $(OUTPUTDIR) ] || rm -rf $(OUTPUTDIR)
devserver: setup
docker run -p 4000:4000 -v $(BASEDIR):/site bretfisher/jekyll-serve
pushupdate:
aws s3 rm --recursive s3://$(S3_BUCKET)
aws s3 sync $(OUTPUTDIR) s3://$(S3_BUCKET) --acl public-read --cache-control max-age=2592000,public
invalidate_cloudfront:
ifeq ($(POST), 3285)
echo "Using EARYRCOOE3IYT for Post $(POST)"
aws cloudfront create-invalidation --distribution-id EARYRCOOE3IYT --path "/*"
endif
publish: clean html pushupdate invalidate_cloudfront
.PHONY: html help clean serve devserver stopserver pushupdate invalidate_cloudfront publish