-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathMakefile
68 lines (54 loc) · 3.06 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
PY?=python3
PELICAN?=pelican
PELICANOPTS=
BASEDIR=$(CURDIR)
INPUTDIR=$(BASEDIR)/content
OUTPUTDIR=$(BASEDIR)/output
CONFFILE=$(BASEDIR)/pelicanconf.py
PUBLISHCONF=$(BASEDIR)/publishconf.py
S3_BUCKET=status.fedoraproject.org
S3_PROFILE=statusfpo
DEBUG ?= 0
ifeq ($(DEBUG), 1)
PELICANOPTS += -D
endif
RELATIVE ?= 0
ifeq ($(RELATIVE), 1)
PELICANOPTS += --relative-urls
endif
help:
@echo 'Makefile for status.fedoraproject.org generation '
@echo ' '
@echo 'Usage: '
@echo ' make clean remove the generated files '
@echo ' make publish generate using production settings '
@echo ' make devserver [PORT=8000] serve and regenerate together '
@echo ' make upload regenerate and upload the content to status.fp.o '
@echo ' make upload-theme regenerate and upload the content and theme on status.fp.o '
@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 ' '
clean:
[ ! -d $(OUTPUTDIR) ] || rm -rf $(OUTPUTDIR)
devserver:
ifdef PORT
$(PELICAN) -lr $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -p $(PORT)
else
$(PELICAN) -lr $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
endif
publish:
$(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS)
upload: publish
aws --profile $(S3_PROFILE) s3 cp $(OUTPUTDIR)/ s3://$(S3_BUCKET)/ --recursive --exclude "theme/*"
aws --profile $(S3_PROFILE) cloudfront create-invalidation --distribution-id E2ROJ0IZ3EJ66H --paths /index.html /resolved.html /changes.rss /ongoing.rss /planned.rss /resolved.rss /ongoing.json /planned.json /resolved.json
githubdeploy: publish
aws s3 cp $(OUTPUTDIR)/ s3://$(S3_BUCKET)/ --recursive --exclude "theme/*"
aws cloudfront create-invalidation --distribution-id E2ROJ0IZ3EJ66H --paths / /index.html /resolved.html /changes.rss /ongoing.rss /planned.rss /resolved.rss /ongoing.json /planned.json /resolved.json
upload-theme: publish
aws --profile $(S3_PROFILE) s3 cp $(OUTPUTDIR)/ s3://$(S3_BUCKET)/ --recursive
aws --profile $(S3_PROFILE) cloudfront create-invalidation --distribution-id E2ROJ0IZ3EJ66H --paths /index.html /resolved.html /changes.rss /ongoing.rss /planned.rss /resolved.rss /ongoing.json /planned.json /resolved.json /theme/*
githubdeploytheme: publish
aws s3 cp $(OUTPUTDIR)/ s3://$(S3_BUCKET)/ --recursive
aws cloudfront create-invalidation --distribution-id E2ROJ0IZ3EJ66H --paths / /index.html /resolved.html /changes.rss /ongoing.rss /planned.rss /resolved.rss /ongoing.json /planned.json /resolved.json /theme/*
.PHONY: help clean devserver publish upload upload-theme