Skip to content

Commit 9651083

Browse files
doc: Basic netlify configuration
Signed-off-by: Furkat Gofurov <[email protected]>
1 parent 8a314f3 commit 9651083

File tree

14 files changed

+281
-462
lines changed

14 files changed

+281
-462
lines changed

docs/book/Makefile

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,30 @@ TOOLS_DIR := $(realpath ../../hack/tools)
1818
TOOLS_BIN_DIR := $(TOOLS_DIR)/bin
1919
BIN_DIR := bin
2020
MDBOOK_INSTALL := $(realpath ../../scripts/ci-install-mdbook.sh)
21+
TABULATE := $(TOOLS_BIN_DIR)/mdbook-tabulate
22+
EMBED := $(TOOLS_BIN_DIR)/mdbook-embed
23+
RELEASELINK := $(TOOLS_BIN_DIR)/mdbook-releaselink
24+
MDBOOK := $(TOOLS_BIN_DIR)/bin/mdbook
2125

2226
export PATH := $(abspath $(TOOLS_BIN_DIR)/bin):$(PATH)
2327

24-
# Only set MDBOOK if it's not set as an environment variable
25-
MDBOOK ?= $(TOOLS_BIN_DIR)/bin/mdbook
28+
BOOK_DEPS := $(MDBOOK) $(TABULATE) $(EMBED) $(RELEASELINK)
29+
30+
$(TOOLS_BIN_DIR)/%: $(TOOLS_DIR_DEPS)
31+
make -C $(TOOLS_DIR) $(subst $(TOOLS_DIR)/,,$@)
32+
2633
$(MDBOOK):
27-
$(MDBOOK_INSTALL) 0.4.35 $(TOOLS_BIN_DIR)
34+
$(MDBOOK_INSTALL) 0.4.37 $(TOOLS_BIN_DIR)
2835

2936
.PHONY: serve
30-
serve: $(MDBOOK)
37+
serve: $(BOOK_DEPS) ## Run a local web server with the compiled book
3138
$(MDBOOK) serve
3239

3340
.PHONY: build
34-
build: $(MDBOOK)
41+
build: $(BOOK_DEPS) ## Build the book
3542
$(MDBOOK) build
3643
cp $(ROOT_DIR)/index.yaml book
44+
45+
.PHONY: clean
46+
clean:
47+
rm -rf book

docs/book/book.toml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,21 @@ src = "src"
55
title = "Cluster API Operator"
66
description = "Cluster API Operator"
77

8-
[preprocessor.toc]
9-
command = "mdbook-toc"
10-
marker = "[[_TOC_]]"
11-
12-
[preprocessor.fs-summary]
13-
# (default: true)
14-
clean-paths = false
15-
16-
# other preprocessors will naturally need to
17-
# run after the summary has been generated
18-
[preprocessor.links]
19-
after = ["fs-summary"]
20-
218
[output.html]
229
mathjax-support = true
2310
git-repository-url = "https://github.com/kubernetes-sigs/cluster-api-operator"
2411
git-repository-icon = "fa-github"
2512
site-url = "/cluster-api-operator/"
2613

14+
[output.html.redirect]
15+
"/agenda.html" = "/agenda/2024.html"
16+
"/agenda/2024.html" = "https://docs.google.com/document/d/1-X4TQBLrGrVhUMTZokwaMil94aA-gXqdJj4Sp3Asdps"
17+
18+
[preprocessor.tabulate]
19+
command = "./util-tabulate.sh"
20+
21+
[preprocessor.embed]
22+
command = "./util-embed.sh"
23+
24+
[preprocessor.releaselink]
25+
command = "./util-releaselink.sh"

docs/book/src/SUMMARY.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[Introduction](./01_intro.md)
2+
-[Installation](./02_installation/00.md)
3+
- [Plugin](./02_installation/01_plugin.md)

docs/book/util-embed.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
# Copyright 2019 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -o errexit
18+
set -o nounset
19+
set -o pipefail
20+
21+
REPO_ROOT=$(git rev-parse --show-toplevel)
22+
EMBED=${REPO_ROOT}/hack/tools/bin/mdbook-embed
23+
make "${EMBED}" GOPROXY="${GOPROXY:-"https://proxy.golang.org"}" &>/dev/null
24+
${EMBED} "$@"

docs/book/util-releaselink.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
# Copyright 2019 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -o errexit
18+
set -o nounset
19+
set -o pipefail
20+
21+
REPO_ROOT=$(git rev-parse --show-toplevel)
22+
RELEASELINK=${REPO_ROOT}/hack/tools/bin/mdbook-releaselink
23+
make "${RELEASELINK}" GOPROXY="${GOPROXY:-"https://proxy.golang.org"}" &>/dev/null
24+
${RELEASELINK} "$@"

docs/book/util-tabulate.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
# Copyright 2019 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -o errexit
18+
set -o nounset
19+
set -o pipefail
20+
21+
REPO_ROOT=$(git rev-parse --show-toplevel)
22+
TABULATE=${REPO_ROOT}/hack/tools/bin/mdbook-tabulate
23+
make "${TABULATE}" GOPROXY="${GOPROXY:-"https://proxy.golang.org"}" &>/dev/null
24+
${TABULATE} "$@"

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ module sigs.k8s.io/cluster-api-operator
22

33
go 1.20
44

5-
replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.6.0
6-
75
require (
86
github.com/MakeNowJust/heredoc v1.0.0
97
github.com/evanphx/json-patch/v5 v5.7.0
@@ -23,7 +21,7 @@ require (
2321
k8s.io/component-base v0.28.5
2422
k8s.io/klog/v2 v2.100.1
2523
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2
26-
sigs.k8s.io/cluster-api v1.6.0
24+
sigs.k8s.io/cluster-api v1.6.1
2725
sigs.k8s.io/controller-runtime v0.16.3
2826
sigs.k8s.io/yaml v1.4.0
2927
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,8 +778,8 @@ rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
778778
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
779779
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.1.2 h1:trsWhjU5jZrx6UvFu4WzQDrN7Pga4a7Qg+zcfcj64PA=
780780
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.1.2/go.mod h1:+qG7ISXqCDVVcyO8hLn12AKVYYUjM7ftlqsqmrhMZE0=
781-
sigs.k8s.io/cluster-api v1.6.0 h1:2bhVSnUbtWI8taCjd9lGiHExsRUpKf7Z1fXqi/IwYx4=
782-
sigs.k8s.io/cluster-api v1.6.0/go.mod h1:LB7u/WxiWj4/bbpHNOa1oQ8nq0MQ5iYlD0pGfRSBGLI=
781+
sigs.k8s.io/cluster-api v1.6.1 h1:I34p/fwgRlEhs+o9cUhKXDwNNfPS3no0yJsd2bJyQVc=
782+
sigs.k8s.io/cluster-api v1.6.1/go.mod h1:DaxwruDvSaEYq5q6FREDaGzX6UsAVUCA99Sp8vfMHyQ=
783783
sigs.k8s.io/controller-runtime v0.16.3 h1:2TuvuokmfXvDUamSx1SuAOO3eTyye+47mJCigwG62c4=
784784
sigs.k8s.io/controller-runtime v0.16.3/go.mod h1:j7bialYoSn142nv9sCOJmQgDXQXxnroFU4VnX/brVJ0=
785785
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=

hack/tools/Makefile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Directories.
2+
BIN_DIR := bin
3+
BIN_DIR_ABS := $(abspath $(BIN_DIR))
4+
SHARE_DIR := share
5+
6+
MDBOOK_EXTRACT_COMMAND := tar xfvz $(SHARE_DIR)/mdbook.tar.gz -C bin
7+
MDBOOK_ARCHIVE_EXT := .tar.gz
8+
9+
MDBOOK_VERSION := v0.4.5
10+
11+
# Tooling binaries.
12+
$(BIN_DIR):
13+
mkdir -p $@
14+
15+
$(SHARE_DIR):
16+
mkdir -p $@
17+
18+
# Binaries.
19+
MDBOOK := $(BIN_DIR)/mdbook
20+
MDBOOK_SHARE := $(SHARE_DIR)/mdbook$(MDBOOK_ARCHIVE_EXT)
21+
$(MDBOOK): $(BIN_DIR) $(SHARE_DIR)
22+
curl -sL -o $(MDBOOK_SHARE) "https://github.com/rust-lang/mdBook/releases/download/$(MDBOOK_VERSION)/mdBook-$(MDBOOK_VERSION)-x86_64-$(RUST_TARGET)$(MDBOOK_ARCHIVE_EXT)"
23+
$(MDBOOK_EXTRACT_COMMAND)
24+
chmod +x $@
25+
touch -m $@
26+
27+
MDBOOK_EMBED := $(BIN_DIR)/mdbook-embed
28+
$(MDBOOK_EMBED): $(BIN_DIR) go.mod go.sum
29+
go build -tags=tools -o $(BIN_DIR)/mdbook-embed sigs.k8s.io/cluster-api/hack/tools/mdbook/embed
30+
31+
MDBOOK_RELEASELINK := $(BIN_DIR)/mdbook-releaselink
32+
$(MDBOOK_RELEASELINK): $(BIN_DIR) go.mod go.sum
33+
go build -tags=tools -o $(BIN_DIR)/mdbook-releaselink sigs.k8s.io/cluster-api/hack/tools/mdbook/releaselink
34+
35+
MDBOOK_TABULATE := $(BIN_DIR)/mdbook-tabulate
36+
$(MDBOOK_TABULATE): $(BIN_DIR) go.mod go.sum
37+
go build -tags=tools -o $(BIN_DIR)/mdbook-tabulate sigs.k8s.io/cluster-api/hack/tools/mdbook/tabulate
38+
39+
.PHONY: clean
40+
clean: ## Remove all tools
41+
rm -rf bin
42+
rm -rf share

hack/tools/go.mod

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
module sigs.k8s.io/cluster-api-operator/hack/tools
22

3-
go 1.20
3+
go 1.21
4+
5+
toolchain go1.21.3
6+
7+
replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.6.1
48

59
require (
610
github.com/drone/envsubst/v2 v2.0.0-20210730161058-179042472c46
711
github.com/joelanford/go-apidiff v0.7.0
812
github.com/onsi/ginkgo/v2 v2.13.2
913
gotest.tools/gotestsum v1.11.0
10-
sigs.k8s.io/cluster-api/hack/tools v0.0.0-20230809141950-03ab8cd50a41
14+
sigs.k8s.io/cluster-api/hack/tools v0.0.0-20240116064735-bfe8d0d16ff3
1115
sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20211110210527-619e6b92dab9
1216
sigs.k8s.io/controller-tools v0.13.0
1317
)
@@ -17,65 +21,64 @@ require (
1721
github.com/Microsoft/go-winio v0.6.1 // indirect
1822
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
1923
github.com/bitfield/gotestdox v0.2.1 // indirect
24+
github.com/blang/semver/v4 v4.0.0 // indirect
2025
github.com/cloudflare/circl v1.3.7 // indirect
2126
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
2227
github.com/dnephin/pflag v1.0.7 // indirect
2328
github.com/emirpasic/gods v1.18.1 // indirect
24-
github.com/fatih/color v1.15.0 // indirect
25-
github.com/fsnotify/fsnotify v1.6.0 // indirect
29+
github.com/fatih/color v1.16.0 // indirect
30+
github.com/fsnotify/fsnotify v1.7.0 // indirect
2631
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
2732
github.com/go-git/go-billy/v5 v5.5.0 // indirect
2833
github.com/go-git/go-git/v5 v5.11.0 // indirect
29-
github.com/go-logr/logr v1.3.0 // indirect
30-
github.com/go-logr/zapr v1.2.0 // indirect
34+
github.com/go-logr/logr v1.4.1 // indirect
35+
github.com/go-logr/zapr v1.2.4 // indirect
3136
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
3237
github.com/gobuffalo/flect v1.0.2 // indirect
3338
github.com/gogo/protobuf v1.3.2 // indirect
3439
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
3540
github.com/google/gofuzz v1.2.0 // indirect
3641
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
3742
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
38-
github.com/hashicorp/errwrap v1.1.0 // indirect
39-
github.com/hashicorp/go-multierror v1.1.1 // indirect
4043
github.com/inconshreveable/mousetrap v1.1.0 // indirect
4144
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
4245
github.com/json-iterator/go v1.1.12 // indirect
4346
github.com/kevinburke/ssh_config v1.2.0 // indirect
4447
github.com/mattn/go-colorable v0.1.13 // indirect
45-
github.com/mattn/go-isatty v0.0.19 // indirect
48+
github.com/mattn/go-isatty v0.0.20 // indirect
4649
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
4750
github.com/modern-go/reflect2 v1.0.2 // indirect
4851
github.com/pjbgf/sha1cd v0.3.0 // indirect
4952
github.com/pkg/errors v0.9.1 // indirect
5053
github.com/sergi/go-diff v1.2.0 // indirect
5154
github.com/skeema/knownhosts v1.2.1 // indirect
52-
github.com/spf13/afero v1.9.5 // indirect
53-
github.com/spf13/cobra v1.7.0 // indirect
55+
github.com/spf13/afero v1.11.0 // indirect
56+
github.com/spf13/cobra v1.8.0 // indirect
5457
github.com/spf13/pflag v1.0.5 // indirect
5558
github.com/xanzy/ssh-agent v0.3.3 // indirect
56-
go.uber.org/atomic v1.10.0 // indirect
57-
go.uber.org/goleak v1.1.12 // indirect
5859
go.uber.org/multierr v1.11.0 // indirect
59-
go.uber.org/zap v1.19.1 // indirect
60-
golang.org/x/crypto v0.17.0 // indirect
61-
golang.org/x/exp v0.0.0-20220921164117-439092de6870 // indirect
62-
golang.org/x/mod v0.13.0 // indirect
63-
golang.org/x/net v0.19.0 // indirect
64-
golang.org/x/sync v0.4.0 // indirect
65-
golang.org/x/sys v0.15.0 // indirect
66-
golang.org/x/term v0.15.0 // indirect
60+
go.uber.org/zap v1.25.0 // indirect
61+
golang.org/x/crypto v0.18.0 // indirect
62+
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
63+
golang.org/x/mod v0.14.0 // indirect
64+
golang.org/x/net v0.20.0 // indirect
65+
golang.org/x/sync v0.5.0 // indirect
66+
golang.org/x/sys v0.16.0 // indirect
67+
golang.org/x/term v0.16.0 // indirect
6768
golang.org/x/text v0.14.0 // indirect
68-
golang.org/x/tools v0.14.0 // indirect
69+
golang.org/x/tools v0.16.1 // indirect
6970
gopkg.in/inf.v0 v0.9.1 // indirect
7071
gopkg.in/warnings.v0 v0.1.2 // indirect
7172
gopkg.in/yaml.v2 v2.4.0 // indirect
7273
gopkg.in/yaml.v3 v3.0.1 // indirect
73-
k8s.io/api v0.28.0 // indirect
74-
k8s.io/apiextensions-apiserver v0.28.0 // indirect
75-
k8s.io/apimachinery v0.28.0 // indirect
74+
k8s.io/api v0.28.5 // indirect
75+
k8s.io/apiextensions-apiserver v0.28.5 // indirect
76+
k8s.io/apimachinery v0.28.5 // indirect
7677
k8s.io/klog/v2 v2.100.1 // indirect
77-
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
78+
k8s.io/utils v0.0.0-20231127182322-b307cd553661 // indirect
79+
sigs.k8s.io/cluster-api v0.0.0-00010101000000-000000000000 // indirect
7880
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
81+
sigs.k8s.io/kubebuilder/docs/book/utils v0.0.0-20211028165026-57688c578b5d // indirect
7982
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
80-
sigs.k8s.io/yaml v1.3.0 // indirect
83+
sigs.k8s.io/yaml v1.4.0 // indirect
8184
)

0 commit comments

Comments
 (0)