forked from privacypatterns/privacypatterns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (32 loc) · 1.25 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
SHELL := /bin/bash
SOURCE_PATTERNS_REPO:=https://github.com/privacypatterns/patterns
PATTERNS_REPO ?= $(SOURCE_PATTERNS_REPO)
PP_PORT ?= 8080
.PHONY: build docker static sync
build: ./site/content/patterns
static: ./site/deploy
docker: ./site/deploy ./site/deploy/changes
@docker build . -t tmp/privacypatterns:local
sync: ./patterns
@echo "Updating content from $(SOURCE_PATTERNS_REPO)"
@cd ./patterns && git checkout master && git pull
./patterns:
@echo "Cloning content from $(SOURCE_PATTERNS_REPO)"
@[ -d ./patterns ] || git clone $(SOURCE_PATTERNS_REPO)
./site/content/patterns: ./patterns ./site/content/patterns/index.html ./site/layout/*
@echo "Generating static files"
@python markdown_to_hyde.py -s ./patterns -d ./site/content/
./hyde/hyde.py:
@echo "Getting hyde"
@git submodule init
@git submodule update
@pip install hyde/.
./site/deploy: ./hyde/hyde.py $(shell find ./site/content/patterns)
@python ./hyde/hyde.py -g -s ./site
@python html_to_search_content.py -s ./site/deploy -d ./site/deploy/media/js/tipuesearch
./site/deploy/changes: ./site/deploy
@git log --pretty=short -n3 > $@
@echo "===================" >> $@
run: docker
@echo "Running privacypatterns on port $(PP_PORT)"
@docker run -it -p $(PP_PORT):80 tmp/privacypatterns:local