forked from open-policy-agent/opa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
71 lines (60 loc) · 1.75 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
DEPLOY_PRIME_URL ?= "http://localhost:8888"
######################################################
#
# Development targets
#
######################################################
.PHONY: clean
clean:
rm -rf ${CURDIR}/website/data/releases.yaml
rm -rf $(CURDIR)/website/generated
rm -rf $(CURDIR)/website/public
rm -rf $(CURDIR)/website/resources
.PHONY: generate
generate:
$(CURDIR)/website/scripts/load-docs.sh
# The website has some npm dependencies saved in ./website/node_modules
# As well as dependencies required for the "live-blocks".
# Use this target to update them as needed.
.PHONY: install-deps
install-deps: live-blocks-install-deps
npm install
# The live-blocks-% pattern target will shim to the
# npm scripts in ./website/scripts/live-blocks
.PHONY: live-blocks-%
live-blocks-%:
cd $(CURDIR)/website/scripts/live-blocks && npm run --silent $*
.PHONY: serve-local
serve-local: production-build
# must be run from root of repo for
# the netlify.toml config to work
cd $(CURDIR)/.. && netlify dev --offline
.PHONY: serve-remote
serve-remote: production-build
# must be run from root of repo for
# the netlify.toml config to work
cd $(CURDIR)/.. && netlify deploy
######################################################
#
# CI targets
#
######################################################
.PHONY: hugo-production-build
hugo-production-build:
hugo \
--source $(CURDIR)/website \
--contentDir generated \
--ignoreCache \
--minify
.PHONY: production-build
production-build: clean generate hugo-production-build live-blocks-inject
.PHONY: preview-build
preview-build:
hugo \
--source $(CURDIR)/website \
--contentDir generated \
--baseURL $(DEPLOY_PRIME_URL) \
--buildDrafts \
--buildFuture \
--ignoreCache
make live-blocks-inject