blob: 5e4805899020f5df72a44d9ed83bf9a1373ef0f8 [file] [log] [blame]
Zack Williamsad366132018-05-14 14:45:47 -07001# Makefile for building CORD docs site, guide.opencord.org
2# Building docs requires the following tools:
3# - Gitbook toolchain: https://toolchain.gitbook.com/setup.html
4# - NPM (for Gitbook and Swagger)
5# - Python (for build glossary script)
6# - linkchecker (for test target) http://wummel.github.io/linkchecker/
7
8default: serve
9
10# use bash for pushd/popd, and to fail if commands within a pipe fail
11SHELL = bash -o pipefail
12
13GENERATED_DOCS =
14
Zack Williamsa719e4a2018-05-16 14:44:36 -070015LINT_STYLE ?= mdl_relaxed.rb
16
Zack Williamsad366132018-05-14 14:45:47 -070017serve: setup
18 gitbook serve --port 4040
19
20build: setup
21 gitbook build
22
Luca Pretee62616d2018-05-24 14:40:18 -070023setup: automation-tools cord-tester xos xos-gui xos-tosca swagger $(GENERATED_DOCS)
Zack Williamsad366132018-05-14 14:45:47 -070024 gitbook init
25 gitbook install
26
27test: linkcheck lint
28
29linkcheck: build
30 linkchecker --check-extern -a _book/
31
32lint:
33 @echo "markdownlint(mdl) version: `mdl --version`"
34 @echo "style config:"
35 @echo "---"
Zack Williamsa719e4a2018-05-16 14:44:36 -070036 @cat $(LINT_STYLE)
Zack Williamsad366132018-05-14 14:45:47 -070037 @echo "---"
Zack Williamsa719e4a2018-05-16 14:44:36 -070038 mdl -s $(LINT_STYLE) `find -L . ! -path "./partials/*" ! -path "./_book/*" ! -path "./node_modules/*" ! -path "./cord-tester/modules/*" -name "*.md"`
Zack Williamsad366132018-05-14 14:45:47 -070039
40# link directories that contain other documentation
Luca Pretee62616d2018-05-24 14:40:18 -070041automation-tools:
42 ln -s ../automation-tools automation-tools
43
Zack Williamsad366132018-05-14 14:45:47 -070044cord-tester:
45 ln -s ../test/cord-tester/docs cord-tester
46
47xos:
48 ln -s ../orchestration/xos/docs xos
49
50xos-gui:
51 ln -s ../orchestration/xos-gui/docs xos-gui
52
53xos-tosca:
54 ln -s ../orchestration/xos-tosca/docs xos-tosca
55
56swagger: xos
57 pushd ../orchestration/xos/docs/; make swagger_docs; popd;
58
59clean:
60 rm -rf $(GENERATED_DOCS)
61 rm -rf _book
62 rm -rf node_modules
Luca Pretee62616d2018-05-24 14:40:18 -070063 rm -rf automation-tools cord-tester test xos xos-gui xos-tosca
Zack Williamsad366132018-05-14 14:45:47 -070064