forked from flemay/3musketeers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (46 loc) · 1.21 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
COMPOSE_RUN_DEV = docker-compose run --rm dev
COMPOSE_UP_DEV = docker-compose up dev
NETLIFYCTL=netlifyctl
CHROMA_STYLE=monokai
# ENVFILE is .env.template by default but can be overwritten
ENVFILE ?= .env.template
# envfile creates or overwrites .env with $(ENVFILE)
envfile:
cp -f $(ENVFILE) .env
.PHONY: envfile
deps: dockerBuild
$(COMPOSE_RUN_NODE) npm install
.PHONY: deps
dockerBuild:
docker-compose build --no-cache dev
.PHONY: dockerBuild
shell:
$(COMPOSE_RUN_DEV) bash
.PHONY: shell
server:
$(COMPOSE_UP_DEV)
.PHONY: server
build:
$(COMPOSE_RUN_DEV) make _build
.PHONY: build
deploy:
$(COMPOSE_RUN_DEV) make _deploy
.PHONY: deploy
clean:
rm -fr static node_modules public
docker-compose down --remove-orphans
.PHONY: clean
# _generateChromaStyle creates the code highlighting.
# Only use it if needing an updated since the source file is already checked in.
_generateChromaStyle:
hugo gen chromastyles --style=$(CHROMA_STYLE) > assets/css/chroma.css
.PHONY: _generateChromaStyle
_build:
hugo -b $${HUGO_BASE_URL}
.PHONY: _build
_server:
hugo server -b $${HUGO_BASE_URL} --bind="0.0.0.0"
.PHONY: _server
_deploy:
@$(NETLIFYCTL) --yes -A $${NETLIFY_TOKEN} deploy --site-id $${NETLIFY_SITE_ID}
.PHONY: _deploy