-
Notifications
You must be signed in to change notification settings - Fork 122
/
Copy pathMakefile
96 lines (74 loc) · 2.43 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
89
90
91
92
93
94
95
96
.PHONY: clean
clean:
./scripts/clean.sh
.PHONY: ensure
ensure:
./scripts/ensure.sh
.PHONY: lint
lint: lint-go lint-markdown
.PHONY: lint-markdown
lint-markdown:
./scripts/lint/lint-markdown.js
.PHONY: lint-go
lint-go: lint-resourcedocsgen lint-mktutorial
.PHONY: lint-resourcedocsgen
lint-resourcedocsgen:
cd tools/resourcedocsgen/ && golangci-lint run --config ../../.golangci.yml --path-prefix tools/resourcedocsgen/
.PHONY: lint-mktutorial
lint-mktutorial:
cd tools/mktutorial/ && golangci-lint run --config ../../.golangci.yml --path-prefix tools/mktutorial/
.PHONY: test
test:
./scripts/test.sh
.PHONY: build
build: build-assets
node scripts/apply-fixes.js
hugo | grep -v -e 'WARN .* REF_NOT_FOUND'
HUGO_SERVE := hugo serve --buildDrafts --buildFuture --ignoreVendorPaths="github.com/pulumi/registry/**/*" | grep -v -e 'WARN .* REF_NOT_FOUND'
# bin/resourcedocsgen is considered to depend on all files in the tools/resourcedocsgen directory.
#
# Caveat: This does not account for `replace` directives in `go.mod`.
bin/resourcedocsgen: $(shell find tools/resourcedocsgen | sed 's@ @\\ @g')
mkdir -p bin
go build -C tools/resourcedocsgen -o ../../bin ./...
# Generate the API docs for `content/registry/packages/<pkg>`, where <pkg> is the name of
# the package to be handed off to resourcedocsgen.
content/registry/packages/%: bin/resourcedocsgen
bin/resourcedocsgen docs registry \
--baseDocsOutDir ./content/registry/packages \
--basePackageTreeJSONOutDir ./static/registry/packages/navs \
$*
# Run hugo locally, ignoring REF_NOT_FOUND warnings
.PHONY: serve
serve:
${HUGO_SERVE}
.PHONY: ci-pull-request
ci-pull-request: ensure
./scripts/ci/pull-request.sh
.PHONY: ci-pull-request-closed
ci-pull-request-closed:
./scripts/ci/pull-request-closed.sh
.PHONY: ci-scheduled
ci-scheduled:
./scripts/ci/scheduled.sh
.PHONY: ci_push
ci_push:: ensure
./scripts/ci/push.sh
.PHONY: serve-assets
serve-assets:
yarn --cwd ./themes/default/theme run start
.PHONY: serve-all
serve-all:
./node_modules/.bin/concurrently --kill-others -r "${HUGO_SERVE}" "yarn --cwd ./themes/default/theme run start"
.PHONY: build-assets
build-assets:
yarn --cwd ./themes/default/theme run build
.PHONY: ci_bucket_cleanup
ci_bucket_cleanup:
./scripts/ci/bucket-cleanup.sh
.PHONY: check_links
check_links: ensure
./scripts/link-checker/check-links.sh "https://www.pulumi.com/registry"
.PHONY: run-browser-tests
run-browser-tests: ensure
./scripts/run-api-docs-tests.sh