Zack Williams | ad36613 | 2018-05-14 14:45:47 -0700 | [diff] [blame] | 1 | # 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 | |
| 8 | default: serve |
| 9 | |
| 10 | # use bash for pushd/popd, and to fail if commands within a pipe fail |
| 11 | SHELL = bash -o pipefail |
| 12 | |
| 13 | GENERATED_DOCS = |
| 14 | |
Zack Williams | a719e4a | 2018-05-16 14:44:36 -0700 | [diff] [blame] | 15 | LINT_STYLE ?= mdl_relaxed.rb |
| 16 | |
Zack Williams | ad36613 | 2018-05-14 14:45:47 -0700 | [diff] [blame] | 17 | serve: setup |
Matteo Scandolo | c93f633 | 2018-05-25 15:19:43 -0700 | [diff] [blame] | 18 | npm start |
Zack Williams | ad36613 | 2018-05-14 14:45:47 -0700 | [diff] [blame] | 19 | |
| 20 | build: setup |
| 21 | gitbook build |
| 22 | |
Matteo Scandolo | 4d51683 | 2018-06-12 07:58:31 -0700 | [diff] [blame] | 23 | setup: automation-tools cord-tester openstack fabric hippie-oss kubernetes-service olt-service onos-service openolt rcord vrouter xos xos-gui xos-tosca swagger $(GENERATED_DOCS) |
Zack Williams | ad36613 | 2018-05-14 14:45:47 -0700 | [diff] [blame] | 24 | gitbook init |
| 25 | gitbook install |
| 26 | |
| 27 | test: linkcheck lint |
| 28 | |
| 29 | linkcheck: build |
| 30 | linkchecker --check-extern -a _book/ |
| 31 | |
| 32 | lint: |
| 33 | @echo "markdownlint(mdl) version: `mdl --version`" |
| 34 | @echo "style config:" |
| 35 | @echo "---" |
Zack Williams | a719e4a | 2018-05-16 14:44:36 -0700 | [diff] [blame] | 36 | @cat $(LINT_STYLE) |
Zack Williams | ad36613 | 2018-05-14 14:45:47 -0700 | [diff] [blame] | 37 | @echo "---" |
Zack Williams | a719e4a | 2018-05-16 14:44:36 -0700 | [diff] [blame] | 38 | mdl -s $(LINT_STYLE) `find -L . ! -path "./partials/*" ! -path "./_book/*" ! -path "./node_modules/*" ! -path "./cord-tester/modules/*" -name "*.md"` |
Zack Williams | ad36613 | 2018-05-14 14:45:47 -0700 | [diff] [blame] | 39 | |
| 40 | # link directories that contain other documentation |
Luca Prete | e62616d | 2018-05-24 14:40:18 -0700 | [diff] [blame] | 41 | automation-tools: |
| 42 | ln -s ../automation-tools automation-tools |
| 43 | |
Zack Williams | ad36613 | 2018-05-14 14:45:47 -0700 | [diff] [blame] | 44 | cord-tester: |
| 45 | ln -s ../test/cord-tester/docs cord-tester |
| 46 | |
Matteo Scandolo | 821477f | 2018-05-29 08:43:13 -0700 | [diff] [blame] | 47 | fabric: |
| 48 | ln -s ../orchestration/xos_services/fabric/docs fabric |
| 49 | |
Matteo Scandolo | 389c563 | 2018-05-31 10:26:39 -0700 | [diff] [blame] | 50 | hippie-oss: |
| 51 | ln -s ../orchestration/xos_services/hippie-oss/docs hippie-oss |
| 52 | |
| 53 | olt-service: |
| 54 | ln -s ../orchestration/xos_services/olt-service/docs olt-service |
| 55 | |
Matteo Scandolo | 4d51683 | 2018-06-12 07:58:31 -0700 | [diff] [blame] | 56 | onos-service: |
| 57 | ln -s ../orchestration/xos_services/onos-service/docs onos-service |
| 58 | |
Scott Baker | 7f7b1aa | 2018-05-31 16:53:30 -0700 | [diff] [blame] | 59 | kubernetes-service: |
| 60 | ln -s ../orchestration/xos_services/kubernetes-service/docs kubernetes-service |
| 61 | |
Matteo Scandolo | f590a0a | 2018-05-30 15:32:09 -0700 | [diff] [blame] | 62 | openolt: |
| 63 | ln -s ../incubator/openolt openolt |
| 64 | |
Matteo Scandolo | 389c563 | 2018-05-31 10:26:39 -0700 | [diff] [blame] | 65 | rcord: |
| 66 | ln -s ../orchestration/profiles/rcord/docs rcord |
| 67 | |
Matteo Scandolo | 821477f | 2018-05-29 08:43:13 -0700 | [diff] [blame] | 68 | vrouter: |
| 69 | ln -s ../orchestration/xos_services/vrouter/docs vrouter |
| 70 | |
Scott Baker | 298ac9e | 2018-06-05 15:15:07 -0700 | [diff] [blame] | 71 | openstack: |
| 72 | ln -s ../orchestration/xos_services/openstack/docs openstack |
| 73 | |
Zack Williams | ad36613 | 2018-05-14 14:45:47 -0700 | [diff] [blame] | 74 | xos: |
| 75 | ln -s ../orchestration/xos/docs xos |
| 76 | |
| 77 | xos-gui: |
| 78 | ln -s ../orchestration/xos-gui/docs xos-gui |
| 79 | |
| 80 | xos-tosca: |
| 81 | ln -s ../orchestration/xos-tosca/docs xos-tosca |
| 82 | |
| 83 | swagger: xos |
| 84 | pushd ../orchestration/xos/docs/; make swagger_docs; popd; |
| 85 | |
| 86 | clean: |
| 87 | rm -rf $(GENERATED_DOCS) |
| 88 | rm -rf _book |
| 89 | rm -rf node_modules |
Matteo Scandolo | 4d51683 | 2018-06-12 07:58:31 -0700 | [diff] [blame] | 90 | 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 |