blob: f1d1b93750870a8a48fb34c5b56b4d1401ce123b [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
Matteo Scandoloc93f6332018-05-25 15:19:43 -070018 npm start
Zack Williamsad366132018-05-14 14:45:47 -070019
20build: setup
21 gitbook build
22
Scott Baker762fd292018-06-12 15:24:41 -070023setup: automation-tools cord-tester simpleexampleservice openstack fabric hippie-oss kubernetes-service olt-service onos-service openolt rcord vrouter 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
Matteo Scandolocc549802018-06-19 11:20:53 -070030 linkchecker -a _book/
Zack Williamsad366132018-05-14 14:45:47 -070031
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
Matteo Scandolo821477f2018-05-29 08:43:13 -070047fabric:
48 ln -s ../orchestration/xos_services/fabric/docs fabric
49
Matteo Scandolo389c5632018-05-31 10:26:39 -070050hippie-oss:
51 ln -s ../orchestration/xos_services/hippie-oss/docs hippie-oss
52
53olt-service:
54 ln -s ../orchestration/xos_services/olt-service/docs olt-service
55
Matteo Scandolo4d516832018-06-12 07:58:31 -070056onos-service:
57 ln -s ../orchestration/xos_services/onos-service/docs onos-service
58
Scott Baker7f7b1aa2018-05-31 16:53:30 -070059kubernetes-service:
60 ln -s ../orchestration/xos_services/kubernetes-service/docs kubernetes-service
61
Matteo Scandolof590a0a2018-05-30 15:32:09 -070062openolt:
63 ln -s ../incubator/openolt openolt
64
Matteo Scandolo389c5632018-05-31 10:26:39 -070065rcord:
66 ln -s ../orchestration/profiles/rcord/docs rcord
67
Matteo Scandolo821477f2018-05-29 08:43:13 -070068vrouter:
69 ln -s ../orchestration/xos_services/vrouter/docs vrouter
70
Scott Baker298ac9e2018-06-05 15:15:07 -070071openstack:
72 ln -s ../orchestration/xos_services/openstack/docs openstack
73
Scott Baker762fd292018-06-12 15:24:41 -070074simpleexampleservice:
75 ln -s ../orchestration/xos_services/simpleexampleservice/docs simpleexampleservice
76
Zack Williamsad366132018-05-14 14:45:47 -070077xos:
78 ln -s ../orchestration/xos/docs xos
79
80xos-gui:
81 ln -s ../orchestration/xos-gui/docs xos-gui
82
83xos-tosca:
84 ln -s ../orchestration/xos-tosca/docs xos-tosca
85
86swagger: xos
87 pushd ../orchestration/xos/docs/; make swagger_docs; popd;
88
89clean:
90 rm -rf $(GENERATED_DOCS)
91 rm -rf _book
92 rm -rf node_modules
Scott Baker762fd292018-06-12 15:24:41 -070093 rm -rf openstack automation-tools cord-tester fabric hippie-oss kubernetes-service olt-service onos-service openolt rcord vrouter test xos xos-gui xos-tosca simpleexampleservice