Zack Williams | 144027f | 2017-09-25 18:01: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 | |
Zack Williams | 1b96a95 | 2017-07-17 16:48:01 -0700 | [diff] [blame] | 8 | default: serve |
Matteo Scandolo | f8cd29f | 2017-09-07 13:57:26 -0700 | [diff] [blame] | 9 | |
Zack Williams | 2d04b0d | 2017-09-25 14:19:55 -0700 | [diff] [blame] | 10 | # use bash for pushd/popd, and to fail if commands within a pipe fail |
| 11 | SHELL = bash -o pipefail |
| 12 | |
Zack Williams | 1b96a95 | 2017-07-17 16:48:01 -0700 | [diff] [blame] | 13 | GENERATED_DOCS = build_glossary.md |
llp | bd786de | 2017-07-07 15:57:27 -0700 | [diff] [blame] | 14 | |
Zack Williams | 1b96a95 | 2017-07-17 16:48:01 -0700 | [diff] [blame] | 15 | serve: setup |
Matteo Scandolo | 57b2117 | 2018-02-05 12:02:26 -0800 | [diff] [blame] | 16 | gitbook serve --port 4040 |
llp | 1827698 | 2017-07-11 11:28:47 -0700 | [diff] [blame] | 17 | |
Zack Williams | 1b96a95 | 2017-07-17 16:48:01 -0700 | [diff] [blame] | 18 | build: setup |
| 19 | gitbook build |
| 20 | |
Zack Williams | 144027f | 2017-09-25 18:01:47 -0700 | [diff] [blame] | 21 | setup: clean platform-install cord-tester profiles xos xos-gui xos-tosca swagger $(GENERATED_DOCS) |
Zack Williams | 1b96a95 | 2017-07-17 16:48:01 -0700 | [diff] [blame] | 22 | gitbook init |
| 23 | gitbook install |
| 24 | |
Zack Williams | 60d5a95 | 2018-01-30 12:07:01 -0700 | [diff] [blame] | 25 | test: linkcheck lint |
Zack Williams | 144027f | 2017-09-25 18:01:47 -0700 | [diff] [blame] | 26 | |
| 27 | linkcheck: build |
Luca Prete | 9bfa6f3 | 2017-12-06 14:37:57 -0800 | [diff] [blame] | 28 | linkchecker --check-extern -a _book/ |
Zack Williams | 144027f | 2017-09-25 18:01:47 -0700 | [diff] [blame] | 29 | |
Zack Williams | 1b96a95 | 2017-07-17 16:48:01 -0700 | [diff] [blame] | 30 | platform-install: |
| 31 | ln -s ../platform-install/docs platform-install |
| 32 | |
Zack Williams | 144027f | 2017-09-25 18:01:47 -0700 | [diff] [blame] | 33 | cord-tester: |
| 34 | ln -s ../../test/cord-tester/docs cord-tester |
Zack Williams | 1b96a95 | 2017-07-17 16:48:01 -0700 | [diff] [blame] | 35 | |
| 36 | profiles: |
Zack Williams | b5cde1d | 2017-12-04 16:57:04 -0700 | [diff] [blame] | 37 | mkdir -p profiles |
Luca Prete | c2f06ed | 2017-10-26 17:04:06 -0700 | [diff] [blame] | 38 | 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 Williams | 1b96a95 | 2017-07-17 16:48:01 -0700 | [diff] [blame] | 41 | |
Zack Williams | be0b2c7 | 2018-01-25 14:48:38 -0700 | [diff] [blame] | 42 | lint: |
| 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 Williams | 60d5a95 | 2018-01-30 12:07:01 -0700 | [diff] [blame] | 49 | mdl -s mdlstyle.rb `find -L . ! -path "./partials/*" ! -path "./_book/*" ! -path "./node_modules/*" ! -path "./cord-tester/modules/*" -name "*.md"` |
Zack Williams | be0b2c7 | 2018-01-25 14:48:38 -0700 | [diff] [blame] | 50 | |
Zack Williams | 1b96a95 | 2017-07-17 16:48:01 -0700 | [diff] [blame] | 51 | xos: |
| 52 | ln -s ../../orchestration/xos/docs xos |
| 53 | |
| 54 | xos-gui: |
| 55 | ln -s ../../orchestration/xos-gui/docs xos-gui |
| 56 | |
| 57 | xos-tosca: |
| 58 | ln -s ../../orchestration/xos-tosca/docs xos-tosca |
| 59 | |
| 60 | build_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 | |
| 63 | swagger: xos |
Matteo Scandolo | f8cd29f | 2017-09-07 13:57:26 -0700 | [diff] [blame] | 64 | pushd ../../orchestration/xos/docs/; make swagger_docs; popd; |
| 65 | |
Zack Williams | 1b96a95 | 2017-07-17 16:48:01 -0700 | [diff] [blame] | 66 | clean: |
| 67 | rm -rf $(GENERATED_DOCS) |
| 68 | rm -rf _book |
| 69 | rm -rf node_modules |
Luca Prete | 9bfa6f3 | 2017-12-06 14:37:57 -0800 | [diff] [blame] | 70 | rm -rf platform-install test profiles xos xos-gui xos-tosca |
Zack Williams | 1b96a95 | 2017-07-17 16:48:01 -0700 | [diff] [blame] | 71 | |