|
1 | | -gendoc: &gendoc |
2 | | - name: Generate the docs |
| 1 | +genlegacydoc: &genlegacydoc |
| 2 | + name: Generate the legacy docs |
3 | 3 | command: | |
4 | 4 | source /env/bin/activate |
5 | 5 | scripts/gendoc.py |
6 | 6 |
|
| 7 | +gendoc: &gendoc |
| 8 | + name: Generate the docs |
| 9 | + # Note: Node dependencies are required for the hugo build. |
| 10 | + # Note: We use a custom config file for circleci due to some specifics with hosting the |
| 11 | + # site using CircleCI's artifacts platform. See config-circleci.toml for details. |
| 12 | + command: | |
| 13 | + apk add nodejs npm git hugo |
| 14 | + npm i |
| 15 | + cat config-circleci.toml config.toml > hugo-config.toml |
| 16 | + hugo --config hugo-config.toml --baseURL "/${CIRCLE_NODE_INDEX}/public" |
| 17 | +
|
7 | 18 | genswagger: &genswagger |
8 | 19 | name: Validate sources and generate swagger json |
9 | 20 | command: | |
@@ -63,17 +74,32 @@ jobs: |
63 | 74 | steps: |
64 | 75 | - checkout |
65 | 76 | - run: *checkexamples |
66 | | - build-docs: |
| 77 | + build-legacy-docs: |
67 | 78 | docker: |
68 | 79 | - image: uhoreg/matrix-doc-build |
69 | 80 | steps: |
70 | 81 | - checkout |
71 | | - - run: *gendoc |
| 82 | + - run: *genlegacydoc |
72 | 83 | - store_artifacts: |
73 | 84 | path: scripts/gen |
74 | 85 | - run: |
75 | | - name: "Doc build is available at:" |
| 86 | + name: "Legacy doc build is available at:" |
76 | 87 | command: DOCS_URL="${CIRCLE_BUILD_URL}/artifacts/${CIRCLE_NODE_INDEX}/${CIRCLE_WORKING_DIRECTORY/#\~/$HOME}/scripts/gen/index.html"; echo $DOCS_URL |
| 88 | + build-docs: |
| 89 | + docker: |
| 90 | + - image: alpine |
| 91 | + steps: |
| 92 | + # Note: We install git in the image so we can pull git submodules. The hugo theme in use |
| 93 | + # is a git submodule, which has its own submodules, and all need to be loaded. |
| 94 | + - run: apk add git |
| 95 | + - checkout |
| 96 | + - run: git submodule update --init --recursive |
| 97 | + - run: *gendoc |
| 98 | + - store_artifacts: |
| 99 | + path: public |
| 100 | + - run: |
| 101 | + name: "Doc build is available at:" |
| 102 | + command: DOCS_URL="${CIRCLE_BUILD_URL}/artifacts/${CIRCLE_NODE_INDEX}/public/index.html"; echo $DOCS_URL |
77 | 103 | build-swagger: |
78 | 104 | docker: |
79 | 105 | - image: uhoreg/matrix-doc-build |
@@ -104,6 +130,7 @@ workflows: |
104 | 130 |
|
105 | 131 | build-spec: |
106 | 132 | jobs: |
| 133 | + - build-legacy-docs |
107 | 134 | - build-docs |
108 | 135 | - build-swagger |
109 | 136 | - check-docs |
|
0 commit comments