diff --git a/evergreen/upload-apidocs.sh b/evergreen/upload-apidocs.sh index 4c4f363bd9f..98981f36b4e 100644 --- a/evergreen/upload-apidocs.sh +++ b/evergreen/upload-apidocs.sh @@ -1,16 +1,40 @@ -#!/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 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