blob: e222f47b087fae2e783b9671cf65e0302c4fea9e [file] [log] [blame]
Zack Williams144027f2017-09-25 18:01: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
Zack Williams1b96a952017-07-17 16:48:01 -07008default: serve
Matteo Scandolof8cd29f2017-09-07 13:57:26 -07009
Zack Williams2d04b0d2017-09-25 14:19:55 -070010# use bash for pushd/popd, and to fail if commands within a pipe fail
11SHELL = bash -o pipefail
12
Zack Williams1b96a952017-07-17 16:48:01 -070013GENERATED_DOCS = build_glossary.md
llpbd786de2017-07-07 15:57:27 -070014
Zack Williams1b96a952017-07-17 16:48:01 -070015serve: setup
Matteo Scandolo57b21172018-02-05 12:02:26 -080016 gitbook serve --port 4040
llp18276982017-07-11 11:28:47 -070017
Zack Williams1b96a952017-07-17 16:48:01 -070018build: setup
19 gitbook build
20
Zack Williams144027f2017-09-25 18:01:47 -070021setup: clean platform-install cord-tester profiles xos xos-gui xos-tosca swagger $(GENERATED_DOCS)
Zack Williams1b96a952017-07-17 16:48:01 -070022 gitbook init
23 gitbook install
24
Zack Williams60d5a952018-01-30 12:07:01 -070025test: linkcheck lint
Zack Williams144027f2017-09-25 18:01:47 -070026
27linkcheck: build
Luca Prete9bfa6f32017-12-06 14:37:57 -080028 linkchecker --check-extern -a _book/
Zack Williams144027f2017-09-25 18:01:47 -070029
Zack Williams1b96a952017-07-17 16:48:01 -070030platform-install:
31 ln -s ../platform-install/docs platform-install
32
Zack Williams144027f2017-09-25 18:01:47 -070033cord-tester:
34 ln -s ../../test/cord-tester/docs cord-tester
Zack Williams1b96a952017-07-17 16:48:01 -070035
36profiles:
Zack Williamsb5cde1d2017-12-04 16:57:04 -070037 mkdir -p profiles
Luca Pretec2f06ed2017-10-26 17:04:06 -070038 ln -s ../../../orchestration/profiles/rcord/docs profiles/rcord
39 ln -s ../../../orchestration/profiles/ecord/docs profiles/ecord
40 ln -s ../../../orchestration/profiles/mcord/docs profiles/mcord
Zack Williams1b96a952017-07-17 16:48:01 -070041
Zack Williamsbe0b2c72018-01-25 14:48:38 -070042lint:
43 @echo "markdownlint(mdl) version: `mdl --version`"
44 @echo "rule descriptions: https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md"
45 @echo "style config:"
46 @echo "---"
47 @cat mdlstyle.rb
48 @echo "---"
Zack Williams60d5a952018-01-30 12:07:01 -070049 mdl -s mdlstyle.rb `find -L . ! -path "./partials/*" ! -path "./_book/*" ! -path "./node_modules/*" ! -path "./cord-tester/modules/*" -name "*.md"`
Zack Williamsbe0b2c72018-01-25 14:48:38 -070050
Zack Williams1b96a952017-07-17 16:48:01 -070051xos:
52 ln -s ../../orchestration/xos/docs xos
53
54xos-gui:
55 ln -s ../../orchestration/xos-gui/docs xos-gui
56
57xos-tosca:
58 ln -s ../../orchestration/xos-tosca/docs xos-tosca
59
60build_glossary.md: scripts/descriptions.md scripts/defaults.md.j2 scripts/defaultsdoc.py scripts/markedyaml.py
61 python scripts/defaultsdoc.py -o build_glossary.md
62
63swagger: xos
Matteo Scandolof8cd29f2017-09-07 13:57:26 -070064 pushd ../../orchestration/xos/docs/; make swagger_docs; popd;
65
Zack Williams1b96a952017-07-17 16:48:01 -070066clean:
67 rm -rf $(GENERATED_DOCS)
68 rm -rf _book
69 rm -rf node_modules
Luca Prete9bfa6f32017-12-06 14:37:57 -080070 rm -rf platform-install test profiles xos xos-gui xos-tosca
Zack Williams1b96a952017-07-17 16:48:01 -070071