Skip to content

Commit 349f7f8

Browse files
authored
Add global build (#1608)
1 parent 6a9f335 commit 349f7f8

File tree

7 files changed

+101
-93
lines changed

7 files changed

+101
-93
lines changed

.github/workflows/validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ jobs:
1414
- name: Checkout Current Repo
1515
uses: actions/checkout@v4
1616
- name: Validate Docs
17-
uses: hazelcast/hazelcast-docs/.github/actions/validate@main
17+
uses: hazelcast/hazelcast-docs-tools/.github/actions/validate-docs@actions/v1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
.vscode/settings.json
1111
/target/
1212
.classpath
13+
global-antora-playbook.yml

README.adoc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,36 @@ If you want to add a change or contribute new content, see our {url-contribute}[
183183

184184
To let us know about something that you'd like us to change, consider {url-org}/hz-docs/issues/new[creating an issue].
185185

186+
== npm scripts
187+
188+
For deployment and development this repository includes the following npm scripts:
189+
190+
.npm scripts
191+
[cols="m,a,a"]
192+
|===
193+
|Script |Description |Notes
194+
195+
|`npm run build`
196+
|Builds a production version of the docs from this repo
197+
|This script depends on Netlify env vars (`REPOSITORY_URL` and `BRANCH`) which you can encode using e.g.: `export REPOSITORY_URL=https://github.com/hazelcast/hz-docs && export BRANCH=pull/445/head && npm run build`
198+
You should generally just use build-local though.
199+
200+
|`npm run build-local`
201+
|Builds a local version of the docs from this repo
202+
|By default, it will build all content sources taken from the link:https://github.com/hazelcast/hazelcast-docs/blob/main/antora-playbook.yml[global antora-playbook]. But if you want to build less, please modify the local link:./antora-playbook.yml[antora-playbook].
203+
204+
|`npm run validate-docs`
205+
|Validates docs
206+
|It will take into consideration all content sources taken from the link:https://github.com/hazelcast/hazelcast-docs/blob/main/antora-playbook.yml[global antora-playbook].
207+
208+
|`npm run check-orphan-pages`
209+
|Checks orphan pages
210+
|
211+
|===
212+
213+
NOTE: Before running any of the scripts please make sure you have installed all latest npm packages via `npm i`.
214+
215+
186216
== License
187217

188218
All documentation is available under the terms of a link:{url-cc}[Creative Commons License]

antora-playbook-local.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

antora-playbook.yml

Lines changed: 25 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,32 @@
1+
# uncomment any of the sections to overwrite the global antora-playbook.yml
2+
13
site:
2-
title: Documentation
4+
# title: Documentation
35
url: https://hardcore-allen-f5257d.netlify.app/
46
start_page: hazelcast:ROOT:what-is-hazelcast.adoc
57
robots: disallow
6-
keys:
7-
docsearch_id: 'QK2EAH8GB0'
8-
docsearch_api: 'ef7bd9485eafbd75d6e8425949eda1f5'
9-
docsearch_index: 'prod_hazelcast_docs'
10-
ai_search_id: '6b326171-dd1e-40c6-a948-1f9bb6c0ed52'
11-
content:
12-
sources:
13-
- url: .
14-
branches: HEAD
15-
start_path: docs
16-
- url: https://github.com/hazelcast/hazelcast-mono
17-
branches: [master]
18-
start_path: docs/rest
8+
# keys:
9+
# docsearch_id: 'QK2EAH8GB0'
10+
# docsearch_api: 'ef7bd9485eafbd75d6e8425949eda1f5'
11+
# docsearch_index: 'prod_hazelcast_docs'
12+
# ai_search_id: '6b326171-dd1e-40c6-a948-1f9bb6c0ed52'
13+
#content:
14+
# sources:
15+
# - url: .
16+
# branches: HEAD
17+
# start_path: docs
18+
# - url: https://github.com/hazelcast/hazelcast-mono
19+
# branches: [master]
20+
# start_path: docs/rest
1921
# - url: https://github.com/hazelcast/hazelcast-code-samples
2022
# branches: [test/docs]
2123
# start_path: docs
22-
ui:
23-
bundle:
24-
url: https://github.com/hazelcast/hazelcast-docs-ui/releases/latest/download/ui-bundle.zip #../hazelcast-docs-ui/build/ui-bundle.zip
25-
snapshot: true
26-
asciidoc:
27-
attributes:
28-
# Download images from kroki at build time (does not work for inline images)
29-
kroki-fetch-diagram: true
30-
# Include next and previous links on each page
31-
page-pagination: true
32-
idprefix: ''
33-
# Separate anchor link names by dashes
34-
idseparator: '-'
35-
# Variables used in the docs
36-
page-survey: https://www.surveymonkey.co.uk/r/NYGJNF9
37-
hazelcast-cloud: Cloud
38-
ucn: User Code Namespaces
39-
ucd: User Code Deployment
40-
extensions:
41-
- ./node_modules/hazelcast-docs-tools/antora-macro/tabs-block.js
42-
- asciidoctor-kroki
43-
- ./node_modules/hazelcast-docs-tools/antora-macro/swagger-ui-block-macro.js
24+
#ui:
25+
# bundle:
26+
# url: https://github.com/hazelcast/hazelcast-docs-ui/releases/latest/download/ui-bundle.zip #../hazelcast-docs-ui/build/ui-bundle.zip
27+
# snapshot: true
28+
#asciidoc:
29+
# extensions:
30+
# - ./node_modules/hazelcast-docs-tools/antora-macro/tabs-block.js
31+
# - asciidoctor-kroki
32+
# - ./node_modules/hazelcast-docs-tools/antora-macro/swagger-ui-block-macro.js

package-lock.json

Lines changed: 35 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,22 @@
55
"author": "Hazelcast Docs",
66
"license": "ISC",
77
"scripts": {
8-
"build": "antora --to-dir docs --fetch antora-playbook.yml",
9-
"build-local": "antora --to-dir test --fetch antora-playbook-local.yml",
10-
"check-orphan-pages": "check-orphan-pages",
8+
"load-antora-playbook": "load-global-playbook",
9+
"build": "npm run load-antora-playbook && antora --to-dir docs --fetch global-antora-playbook.yml",
10+
"load-antora-playbook-local": "load-global-playbook -b main -r hazelcast/hz-docs --skip-private-repos",
11+
"build-local": "npm run load-antora-playbook-local && antora --to-dir test --fetch global-antora-playbook.yml",
12+
"load-validate-docs-playbook": "load-global-playbook -b main -r hazelcast/hz-docs --skip-private-repos --enforce-global-sources",
13+
"validate-docs": "npm run load-validate-docs-playbook && antora --fetch --to-dir test --log-level=warn --log-failure-level=warn --extension=./node_modules/hazelcast-docs-tools/antora-extensions/antora-link-checker-extension.js global-antora-playbook.yml",
14+
"check-orphan-pages": "check-orphan-pages --log-failure-level=error",
1115
"serve": "serve test",
12-
"expose": "ngrok http 5000"
16+
"expose": "ngrok http 3000"
1317
},
1418
"devDependencies": {
1519
"@antora/cli": "^3.1.1",
1620
"@antora/site-generator": "^3.1.1",
1721
"@asciidoctor/core": "^2.0.0",
1822
"asciidoctor-kroki": "^0.10.0",
19-
"hazelcast-docs-tools": "github:hazelcast/hazelcast-docs-tools#v1.1.0",
23+
"hazelcast-docs-tools": "github:hazelcast/hazelcast-docs-tools#v2.1.0",
2024
"ngrok": "^5.0.0-beta.2",
2125
"serve": "^14.2.4"
2226
},

0 commit comments

Comments
 (0)