From 50ec9d8ccd274e6e13381172a01eecf950e88bb9 Mon Sep 17 00:00:00 2001 From: Oleksandr Poliakov Date: Fri, 28 Nov 2025 16:04:33 -0800 Subject: [PATCH 1/3] CSHARP-5799: Implement api-docs redirection page to the latest version --- evergreen/upload-apidocs.sh | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/evergreen/upload-apidocs.sh b/evergreen/upload-apidocs.sh index 4c4f363bd9f..59bc0db8398 100644 --- a/evergreen/upload-apidocs.sh +++ b/evergreen/upload-apidocs.sh @@ -1,16 +1,39 @@ -#!/usr/bin/env bash +#!/usr/bin/env bash set -o errexit # Exit the script with error if any of the commands fail DOCS_REPO="https://${GITHUB_USER}:${GITHUB_APIKEY}@github.com/mongodb/mongo-csharp-driver.git" -echo "Prepare github docs" +echo "Cloning github repo..." git clone "$DOCS_REPO" ./gh-pages/ --branch gh-pages --single-branch +echo "Adding the generated API-docs site..." mkdir ./gh-pages/"$PACKAGE_VERSION"/ cp -r ./artifacts/apidocs/"$PACKAGE_VERSION"/. ./gh-pages/"$PACKAGE_VERSION"/ cd ./gh-pages +echo "Generating redirection page..." +# setup simple redirection to the latest version. +rm -f ./api.html +cat > "api.html" << EOL + + + + Redirecting... + + + + + +

Redirecting you to the latest API Docs...

+ + + +EOL + +echo "Pushing the changes..." git add --all git commit -m "Add $PACKAGE_VERSION Api docs" --author="Build Agent" git push --repo="$DOCS_REPO" + +echo "Done." From 9918b3d6311c333e5c5977e81e5804032892d336 Mon Sep 17 00:00:00 2001 From: Oleksandr Poliakov Date: Fri, 28 Nov 2025 16:51:08 -0800 Subject: [PATCH 2/3] pr --- evergreen/upload-apidocs.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/evergreen/upload-apidocs.sh b/evergreen/upload-apidocs.sh index 59bc0db8398..98981f36b4e 100644 --- a/evergreen/upload-apidocs.sh +++ b/evergreen/upload-apidocs.sh @@ -14,6 +14,7 @@ cd ./gh-pages echo "Generating redirection page..." # setup simple redirection to the latest version. + rm -f ./api.html cat > "api.html" << EOL @@ -21,11 +22,11 @@ cat > "api.html" << EOL Redirecting... - - + + -

Redirecting you to the latest API Docs...

+

Redirecting you to the latest API Docs...

From 7c32871393f3bf166f800fb4ba77047af35a9006 Mon Sep 17 00:00:00 2001 From: Oleksandr Poliakov Date: Mon, 1 Dec 2025 09:53:54 -0800 Subject: [PATCH 3/3] pr --- evergreen/upload-apidocs.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evergreen/upload-apidocs.sh b/evergreen/upload-apidocs.sh index 98981f36b4e..8db19054e98 100644 --- a/evergreen/upload-apidocs.sh +++ b/evergreen/upload-apidocs.sh @@ -15,8 +15,8 @@ cd ./gh-pages echo "Generating redirection page..." # setup simple redirection to the latest version. -rm -f ./api.html -cat > "api.html" << EOL +rm -f ./latest.html +cat > "latest.html" << EOL