-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
58 lines (43 loc) · 1.76 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
NANOC = bundle exec nanoc
GUARD = bundle exec guard
DOWNLOADS := docs caduceus svalinn gungnir fenrir heimdall
.default: build
bundle:
bundle config build.nokogiri --use-system-libraries
bundle config set path 'vendor'
bundle install
CNAME:
@mkdir -p docs
echo "xmidt.io" > docs/CNAME
clean:
rm -rf docs \
downloads \
repositories \
content/docs/codex/swagger.html \
clean-all: clean
rm -rf vendor tmp
build: bundle downloads swagger CNAME
$(NANOC)
downloads: $(DOWNLOADS:%=downloads/%/repo.json) $(DOWNLOADS:%=downloads/%/releases.json)
downloads/%/repo.json:
@mkdir -p $(dir $@)
@echo "curl -sf -H 'Accept: application/vnd.github.v3+json' <GITHUB_AUTHENTICATION> https://api.github.com/repos/xmidt-org/$* > $@"
@curl -sf -H 'Accept: application/vnd.github.v3+json' $(GITHUB_AUTHENTICATION) https://api.github.com/repos/xmidt-org/$* > $@
downloads/%/releases.json:
@mkdir -p $(dir $@)
@echo "curl -sf -H 'Accept: application/vnd.github.v3+json' <GITHUB_AUTHENTICATION> https://api.github.com/repos/xmidt-org/$*/releases > $@"
@curl -sf -H 'Accept: application/vnd.github.v3+json' $(GITHUB_AUTHENTICATION) https://api.github.com/repos/xmidt-org/$*/releases > $@
guard:
$(GUARD)
serve:
$(NANOC) view
swagger-codex:
npx redoc-cli bundle -o tmp.html --title "Codex Documentation" content/docs/codex/codex.yaml
@echo "---" > content/docs/codex/swagger.html
@echo "title: Swagger" >> content/docs/codex/swagger.html
@echo "sort_rank: 15" >> content/docs/codex/swagger.html
@echo "---" >> content/docs/codex/swagger.html
cat tmp.html >> content/docs/codex/swagger.html
rm tmp.html
swagger: swagger-codex
.PHONY: build bundle clean clean-all build downloads serve swagger swagger-codex