blob: 892bae1fdba1be0b9a05b2a564ca210f2e229f79 [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 Scandolo8a76f922017-08-29 14:02:58 -070016 gitbook serve
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 Williams144027f2017-09-25 18:01:47 -070025test: linkcheck
26
27linkcheck: build
28 linkchecker -a _book/
29
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:
37 ln -s ../../orchestration/profiles profiles
38
39xos:
40 ln -s ../../orchestration/xos/docs xos
41
42xos-gui:
43 ln -s ../../orchestration/xos-gui/docs xos-gui
44
45xos-tosca:
46 ln -s ../../orchestration/xos-tosca/docs xos-tosca
47
48build_glossary.md: scripts/descriptions.md scripts/defaults.md.j2 scripts/defaultsdoc.py scripts/markedyaml.py
49 python scripts/defaultsdoc.py -o build_glossary.md
50
51swagger: xos
Matteo Scandolof8cd29f2017-09-07 13:57:26 -070052 pushd ../../orchestration/xos/docs/; make swagger_docs; popd;
53
Zack Williams1b96a952017-07-17 16:48:01 -070054clean:
55 rm -rf $(GENERATED_DOCS)
56 rm -rf _book
57 rm -rf node_modules
58 rm -f platform-install test profiles xos xos-gui xos-tosca
59