Skip to content

Commit 1f00882

Browse files
authored
Merge branch 'main' into fix/deploy-action-typo
2 parents 6331a71 + 4a20393 commit 1f00882

File tree

3 files changed

+34
-7
lines changed

3 files changed

+34
-7
lines changed

Makefile

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,37 @@
1-
PLAYBOOK := local-antora-playbook.yml
2-
ANTORAFLAGS :=
1+
CURRENT_COMMIT := $(shell git rev-parse HEAD)
32

4-
build:
3+
build-dev: build-ui
4+
node_modules/.bin/antora generate local-antora-playbook.yml
5+
6+
build-prod: build-ui
7+
node_modules/.bin/antora generate antora-playbook.yml --fetch
8+
9+
build-ui:
510
node_modules/.bin/gulp --cwd ui bundle
6-
node_modules/.bin/antora generate $(PLAYBOOK) $(ANTORAFLAGS)
711

8-
.PHONY: clean
912
clean:
1013
rm -r build
1114
# 'cache' is the configured cache dir in the playbook
1215
rm -r cache
1316

14-
.PHONY: build
17+
# The netlify repo is checked out without any blobs. This script
18+
# iterates through the release branches and checks them out one-by-one
19+
# to fetch all the files.
20+
# Then we can build directly from here, making it possible to build
21+
# with antora using the HEAD (enabling branch previews!)
22+
netlify-fetch:
23+
git submodule update --init --recursive
24+
# netlify messes with some files, restore everything to how it was:
25+
git reset --hard --recurse-submodule
26+
# fetch, because netlify does caching and we want to get the latest commits
27+
git fetch --all
28+
# checkout all release branches once, so we fetch the files
29+
for remote in $(shell git branch -r | grep release/); do \
30+
git checkout --recurse-submodules "$${remote#origin/}" ;\
31+
done
32+
# go back to the initial commit to start the build
33+
git -c advice.detachedHead=false checkout --recurse-submodules $(CURRENT_COMMIT)
34+
35+
netlify-build: netlify-fetch build-prod
36+
37+
.PHONY: build-dev build-prod build-ui clean netlify-build netlify-fetch

antora-playbook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ urls:
1515

1616
content:
1717
sources:
18-
- url: https://github.com/stackabletech/documentation.git
18+
- url: .
1919
branches:
2020
- HEAD
2121
- release/23.4

netlify.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[build]
2+
command = "make netlify-build"
3+
publish = "build/site"
4+
15
[[redirects]]
26
from = "/airflow/nightly/*"
37
to = "/home/nightly/airflow/:splat"

0 commit comments

Comments
 (0)