From c9f35442d3790f58354807dd688829215b9f46ad Mon Sep 17 00:00:00 2001 From: Camila Macedo Date: Mon, 14 Aug 2023 15:19:47 +0100 Subject: [PATCH] :bug: fix doc preview --- docs/book/book.toml | 8 +++++++- docs/book/install-and-build.sh | 12 ++++++++---- netlify.toml | 2 +- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/docs/book/book.toml b/docs/book/book.toml index c6244a05df..557e903a20 100644 --- a/docs/book/book.toml +++ b/docs/book/book.toml @@ -5,7 +5,6 @@ src = "src" title = "The Kubebuilder Book" [output.html] -google-analytics = "UA-119864590-1" curly-quotes = true additional-css = ["theme/css/markers.css", "theme/css/custom.css", "theme/css/version-dropdown.css"] git-repository-url = "https://github.com/kubernetes-sigs/kubebuilder" @@ -16,3 +15,10 @@ command = "./litgo.sh" [preprocessor.markerdocs] command = "./markerdocs.sh" + +[context.environment] + environment = { GO_VERSION = "1.20" } + +[context.deploy-preview.environment] + environment = { GO_VERSION = "1.20" } + diff --git a/docs/book/install-and-build.sh b/docs/book/install-and-build.sh index 1d6fc26359..81c72a7bdd 100755 --- a/docs/book/install-and-build.sh +++ b/docs/book/install-and-build.sh @@ -23,7 +23,10 @@ THIS_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) cd "$THIS_DIR" -[[ -n "$(command -v gimme)" ]] && eval "$(gimme stable)" +if [[ -n "$(command -v gimme)" ]]; then + GO_VERSION=${GO_VERSION:-stable} # Use the provided GO_VERSION or default to 'stable' + eval "$(gimme $GO_VERSION)" +fi echo go version GOBIN=$THIS_DIR/functions go install ./... @@ -60,14 +63,15 @@ esac # grab mdbook # we hardcode linux/amd64 since rust uses a different naming scheme and it's a pain to tran -echo "downloading mdBook-v0.4.21-${arch}-${target}.${ext}" +echo "downloading mdBook-v0.4.34-${arch}-${target}.${ext}" set -x -curl -sL -o /tmp/mdbook.${ext} https://github.com/rust-lang-nursery/mdBook/releases/download/v0.4.2/mdBook-v0.4.2-${arch}-${target}.${ext} +curl -sL -o /tmp/mdbook.${ext} https://github.com/rust-lang/mdBook/releases/download/v0.4.34/mdBook-v0.4.34-${arch}-${target}.${ext} ${cmd} /tmp/mdbook.${ext} chmod +x /tmp/mdbook echo "grabbing the latest released controller-gen" -go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.12.0 +go version +go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.12.1 # make sure we add the go bin directory to our path gobin=$(go env GOBIN) diff --git a/netlify.toml b/netlify.toml index 388292ee44..d3dd304a5a 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,6 +1,6 @@ [build] base = "docs/book" - command = "./install-and-build.sh" + command = "GO_VERSION=1.20 ./install-and-build.sh" publish = "docs/book/book" functions = "docs/book/functions"