|
24 | 24 | # Build hooks can modify the application files on disk but not access any services like databases. |
25 | 25 | build: | |
26 | 26 | set -e |
27 | | - mkdir -p "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/" |
28 | | - # add yet another fall back redirect in case all the others fail |
29 | | - echo '<html><head><meta http-equiv="refresh" content="0; url=https://docs.upsun.com/api/"></head>' > "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html" |
30 | | - echo '<body><p>API documentation has moved to <a href="https://docs.upsun.com/api/">https://docs.upsun.com/api/</a></p></body></html>' >> "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html" |
| 27 | + # Public API Docs |
| 28 | + mkdir -p "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/styles" |
| 29 | + if [ -f "${PLATFORM_APP_DIR}/shared/pages/api.html" ]; then |
| 30 | + # @todo refactor so we're not copying over the old platform.sh api docs as well or just remove them |
| 31 | + cp -a "${PLATFORM_APP_DIR}/shared/pages/." "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/" |
| 32 | + mv "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/api.html" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html" |
| 33 | + cp "${PLATFORM_APP_DIR}/shared/pages/api-style.css" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/styles/style.css" |
| 34 | + else |
| 35 | + echo "<p>Currently under maintenance. Please check back later.</p>" >> "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html" |
| 36 | + fi |
| 37 | +
|
| 38 | + # Internal API Docs |
| 39 | + mkdir -p "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api-internal/styles" |
| 40 | + if [ -f "${PLATFORM_APP_DIR}/shared/pages/api-internal.html" ]; then |
| 41 | + # @todo refactor so we're not copying over the old platform.sh api docs as well or just remove them |
| 42 | + cp -a "${PLATFORM_APP_DIR}/shared/pages/." "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api-internal/" |
| 43 | + mv "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api-internal/api-internal.html" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api-internal/index.html" |
| 44 | + cp "${PLATFORM_APP_DIR}/shared/pages/api-style.css" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api-internal/styles/style.css" |
| 45 | + else |
| 46 | + echo "<p>Currently under maintenance. Please check back later.</p>" >> "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api-internal/index.html" |
| 47 | + fi |
31 | 48 |
|
32 | 49 | cd $SITE_DIR |
33 | 50 | cp ../../themes/psh-docs/postcss.config.js . |
|
71 | 88 | root: 'sites/platform/public/api' |
72 | 89 | index: [ 'index.html' ] |
73 | 90 | expires: 24h |
| 91 | + '/api-internal': |
| 92 | + root: 'sites/platform/public/api-internal' |
| 93 | + index: [ 'index.html' ] |
| 94 | + expires: 24h |
| 95 | + |
74 | 96 | disk: 1024 |
75 | 97 |
|
76 | 98 | mounts: |
|
107 | 129 | build: | |
108 | 130 | #copy API docs into correct location |
109 | 131 | # @todo once api docs are fully moved we can alter the template.hbs file so style.css can be in /api |
| 132 | +
|
| 133 | + # Public API Docs |
110 | 134 | mkdir -p "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/styles" |
111 | 135 | if [ -f "${PLATFORM_APP_DIR}/shared/pages/api.html" ]; then |
112 | 136 | # @todo refactor so we're not copying over the old platform.sh api docs as well or just remove them |
|
116 | 140 | else |
117 | 141 | echo "<p>Currently under maintenance. Please check back later.</p>" >> "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html" |
118 | 142 | fi |
| 143 | +
|
| 144 | + # Internal API Docs |
| 145 | + mkdir -p "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api-internal/styles" |
| 146 | + if [ -f "${PLATFORM_APP_DIR}/shared/pages/api-internal.html" ]; then |
| 147 | + # @todo refactor so we're not copying over the old platform.sh api docs as well or just remove them |
| 148 | + cp -a "${PLATFORM_APP_DIR}/shared/pages/." "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api-internal/" |
| 149 | + mv "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api-internal/api-internal.html" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api-internal/index.html" |
| 150 | + cp "${PLATFORM_APP_DIR}/shared/pages/api-style.css" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api-internal/styles/style.css" |
| 151 | + else |
| 152 | + echo "<p>Currently under maintenance. Please check back later.</p>" >> "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api-internal/index.html" |
| 153 | + fi |
| 154 | +
|
119 | 155 | cd $SITE_DIR |
120 | 156 | cp ../../themes/psh-docs/postcss.config.js . |
121 | 157 | npm install |
|
161 | 197 | root: 'sites/upsun/public/api' |
162 | 198 | index: [ 'index.html' ] |
163 | 199 | expires: 24h |
| 200 | + '/api-internal': |
| 201 | + root: 'sites/upsun/public/api-internal' |
| 202 | + index: [ 'index.html' ] |
| 203 | + expires: 24h |
164 | 204 |
|
165 | 205 | disk: 1024 |
166 | 206 |
|
|
0 commit comments