File tree Expand file tree Collapse file tree 5 files changed +20
-8
lines changed Expand file tree Collapse file tree 5 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -12,14 +12,15 @@ MDBOOK_BIN := $(TOOLS_BIN_DIR)/mdbook
1212export PATH := $(PATH ) :$(TOOLS_BIN_DIR )
1313
1414# # ------------------------------------
15- # # Resolve placeholders as tags
15+ # # mdbook plugins
1616# # ------------------------------------
1717RELEASETAGS := $(TOOLS_BIN_DIR ) /mdbook-releasetags
1818$(RELEASETAGS ) : $(TOOLS_DIR ) /go.mod
1919 cd $(TOOLS_DIR ) ; go build -tags=tools -o $(TOOLS_BIN_DIR ) /mdbook-releasetags ./releasetags
2020
21- .PHONY : releasetags
22- releasetags : $(RELEASETAGS )
21+ MDBOOK_EMBED := $(TOOLS_BIN_DIR ) /mdbook-embed
22+ $(MDBOOK_EMBED ) : $(TOOLS_DIR ) /go.mod
23+ cd $(TOOLS_DIR ) ; go build -tags=tools -o $(TOOLS_BIN_DIR ) /mdbook-embed sigs.k8s.io/cluster-api/hack/tools/mdbook/embed
2324
2425# # ------------------------------------
2526# # Documentation tooling for Netlify
@@ -32,7 +33,7 @@ $(MDBOOK_BIN): # Download the binary
3233 curl -L $(MDBOOK_RELEASE_URL ) | tar xvz -C $(TOOLS_BIN_DIR )
3334
3435.PHONY : netlify-build
35- netlify-build : $(RELEASETAGS ) $(MDBOOK_BIN )
36+ netlify-build : $(MDBOOK_EMBED ) $( RELEASETAGS ) $(MDBOOK_BIN )
3637 $(MDBOOK_BIN ) build $(SOURCE_PATH )
3738
3839
Original file line number Diff line number Diff line change 1- ARG BUILD_IMAGE=docker.io/golang:1.21.9 @sha256:7d0dcbe5807b1ad7272a598fbf9d7af15b5e2bed4fd6c4c2b5b3684df0b317dd
1+ ARG BUILD_IMAGE=docker.io/golang:1.25.3 @sha256:6ea52a02734dd15e943286b048278da1e04eca196a564578d718c7720433dbbe
22FROM $BUILD_IMAGE AS builder
33WORKDIR /workspace
44
@@ -21,11 +21,13 @@ COPY hack/tools/releasetags/ releasetags/
2121ARG ARCH=amd64
2222RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} \
2323 go build -tags=tools -a -ldflags '-extldflags "-static"' \
24- -o mdbook-releasetags ./releasetags
24+ -o mdbook-releasetags ./releasetags && \
25+ go build -tags=tools -a -ldflags '-extldflags "-static"' \
26+ -o mdbook-embed sigs.k8s.io/cluster-api/hack/tools/mdbook/embed
2527ARG MDBOOK_RELEASE_URL="https://github.com/rust-lang/mdBook/releases/download/v0.4.52/mdbook-v0.4.52-x86_64-unknown-linux-gnu.tar.gz"
2628RUN curl -L "${MDBOOK_RELEASE_URL}" \
2729 | tar xvz -C /workspace
2830
2931FROM netlify/build:noble
3032WORKDIR /workdir
31- COPY --from=builder /workspace/mdbook-releasetags /workspace/mdbook /usr/bin/
33+ COPY --from=builder /workspace/mdbook* /usr/bin/
Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ title = "Metal³ user-guide"
66
77[preprocessor .releasetags ]
88
9+ [preprocessor .embed ]
10+ command = " mdbook-embed"
11+
912[output .html ]
1013git-repository-url = " https://github.com/metal3-io/"
1114smart-punctuation = true
Original file line number Diff line number Diff line change 11module metal3-io/metal3-docs/hack/tools
22
3- go 1.21
3+ go 1.24.0
44
55require (
66 github.com/blang/semver v3.5.1+incompatible
77 sigs.k8s.io/kubebuilder/docs/book/utils v0.0.0-20240216033807-8afeb403549f
88)
9+
10+ require sigs.k8s.io/cluster-api/hack/tools v0.0.0-20251020054008-0978f70c29b1 // indirect
11+
12+ tool sigs.k8s.io/cluster-api/hack/tools/mdbook/embed
Original file line number Diff line number Diff line change 11github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ =
22github.com/blang/semver v3.5.1+incompatible /go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk =
3+ sigs.k8s.io/cluster-api/hack/tools v0.0.0-20251020054008-0978f70c29b1 h1:FxcZZdIxGOHIgl4ETvsuSYR3eKozMZTKCarNRI/Ix74 =
4+ sigs.k8s.io/cluster-api/hack/tools v0.0.0-20251020054008-0978f70c29b1 /go.mod h1:l26LNezuh0r/oQ492SQqIGpTCxkmSwymKnvXjCPz6hE =
35sigs.k8s.io/kubebuilder/docs/book/utils v0.0.0-20240216033807-8afeb403549f h1:0rbnCuTF/IIxfwoJR/p7zTB5+AA0RaBwB0lqjBUs/28 =
46sigs.k8s.io/kubebuilder/docs/book/utils v0.0.0-20240216033807-8afeb403549f /go.mod h1:4CGoZGcqb7Bes5d0qgb4SIHqk+XjUfoxesbbTmpVl6s =
You can’t perform that action at this time.
0 commit comments