-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
83 lines (66 loc) · 1.93 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
STACK_MODULE ?= "*"
IP ?= 0.0.0.0
LOGLEVEL ?= INFO
ENV ?= development
HUGO_CONTENT ?= ./content/en
HUGO_BUILD ?= --gc
HUGO_SERVER ?= --disableFastRender -b http://$(IP) --bind $(IP)
DOCKER_IMAGE=image-redis-stack-website
DOCKER_CONTAINER=container-$(DOCKER_IMAGE)
DOCKER_PORT=-p 1313:1313
.PHONY: all deps init build up clean docker-build docker-make docker docker-up docker-sh netlify
ifeq ($(ENV),production)
GET_META=--production
endif
ifeq ($(DEBUG),1)
HUGO_DEBUG=--debug --log
LOGLEVEL ?= DEBUG
endif
ifeq ($(SKIP_CLONE),1)
SKIP_CLONE=--skip-clone
endif
all: build
deps:
@pip install -r requirements.txt
@npm install
build:
# @python3 build/get_meta.py $(GET_META) --loglevel=$(LOGLEVEL)
@python3 build/make_stack.py $(SKIP_CLONE) --module=$(STACK_MODULE) --loglevel=$(LOGLEVEL)
@cp -R data/*.json $(HUGO_CONTENT)
@hugo $(HUGO_DEBUG) $(HUGO_BUILD)
docs: build
@python3 build/generate_examples_index.py
@mkdocs build -d docsbuild
up:
hugo server $(HUGO_DEBUG) $(HUGO_SERVER) -w --environment $(ENV)
clean:
# @rm -f data/*.json
@rm -rf $(HUGO_CONTENT) examples public tmp
ifneq ($(VOL),)
DOCKER_VOL=-v $(VOL):$(VOL)
endif
docker-build:
@docker build -t $(DOCKER_IMAGE) .
docker-make: docker-build
@docker run -t \
--env PRIVATE_ACCESS_TOKEN=$(PRIVATE_ACCESS_TOKEN) \
--env SKIP_CLONE=$(SKIP_CLONE) \
--env GET_STATS=$(GET_STATS) \
--env LOGLEVEL=$(LOGLEVEL) \
--env STACK_MODULE=$(STACK_MODULE) \
$(DOCKER_IMAGE) make clean build
docker docker-up: docker-make
@docker run -it $(DOCKER_PORT) $(DOCKER_IMAGE) make up
docker-sh:
@docker run -it $(DOCKER_PORT) $(DOCKER_VOL) $(DOCKER_IMAGE) bash
docker-all: docker-build docker-make
@docker create --name $(DOCKER_CONTAINER) $(DOCKER_IMAGE)
@docker cp $(DOCKER_CONTAINER):/build/public - > public.tar
@docker rm -v $(DOCKER_CONTAINER)
@rm -rf public/
@tar xvf public.tar
@rm public.tar
netlify:
@echo "INCOMING_HOOK_BODY: $(INCOMING_HOOK_BODY)"
@make all
@cp _redirects public