forked from pulumi/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
88 lines (73 loc) · 1.94 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
84
85
86
87
88
# The HUGO_ENVIRONMENT environment variable determines which Hugo environment
# to build/serve.
HUGO_ENVIRONMENT ?= development
.PHONY: default
default: banner generate build
.PHONY: all
all: banner generate build
.PHONY: banner
banner:
@echo -e "\033[1;37m=========================\033[0m"
@echo -e "\033[1;37mPulumi Website \033[0m"
@echo -e "\033[1;37m=========================\033[0m"
.PHONY: ensure
ensure:
yarn install
yarn --cwd components install
.PHONY: lint_markdown
lint_markdown:
yarn lint-markdown
.PHONY: serve
serve:
@echo -e "\033[0;32mSERVE:\033[0m"
yarn lint-markdown --no-error
yarn --cwd components run build
$(MAKE) copy_static_prebuilt
hugo server --buildDrafts --buildFuture --renderToDisk
.PHONY: serve-components
serve-components:
@echo -e "\033[0;32mSERVE COMPONENTS:\033[0m"
yarn --cwd components run start
.PHONY: generate
generate:
@echo -e "\033[0;32mGENERATE:\033[0m"
./scripts/run_typedoc.sh
./scripts/generate_python_docs.sh
pulumi gen-markdown ./content/docs/reference/cli
./scripts/mktutorial.sh
.PHONY: resource_docs
resource_docs::
./scripts/gen_resource_docs.sh
.PHONY: copy_static_prebuilt
copy_static_prebuilt:
mkdir -p public && cp -R static-prebuilt/* public/
.PHONY: build
build:
@echo -e "\033[0;32mBUILD ($(HUGO_ENVIRONMENT)):\033[0m"
yarn lint-markdown
NODE_ENV=production yarn --cwd components run build
$(MAKE) copy_static_prebuilt
./scripts/run-hugo-build.sh
node ./scripts/build-search-index.js < ./public/docs/search-data/index.json > ./public/docs/search-index.json
rm -rf ./public/docs/search-data
.PHONY: test
test:
./scripts/check-links.sh
.PHONY: ci_push
ci_push::
$(MAKE) banner
$(MAKE) ensure
$(MAKE) build
./scripts/run-pulumi.sh update production
.PHONY: ci_pull_request
ci_pull_request::
$(MAKE) banner
$(MAKE) ensure
$(MAKE) build
./scripts/run-pulumi.sh preview production
.PHONY: ci_cron
ci_cron::
$(MAKE) banner
$(MAKE) ensure
$(MAKE) build
$(MAKE) test