From 8703713538164a13b39ae663161f0a6fb64f6753 Mon Sep 17 00:00:00 2001 From: Brandon Ly Date: Thu, 6 Feb 2025 13:42:36 -0500 Subject: [PATCH 01/17] Update build.sh --- build.sh | 42 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/build.sh b/build.sh index a5e150320..d69b38e9d 100644 --- a/build.sh +++ b/build.sh @@ -1,7 +1,37 @@ -# ensures that we always use the latest version of the script -if [ -f build-site.sh ]; then - rm build-site.sh -fi +PARSER_VERSION=0.18.12 -curl https://raw.githubusercontent.com/mongodb/docs-worker-pool/netlify-poc/scripts/build-site.sh -o build-site.sh -sh build-site.sh +# This make command curls the examples for certain repos. +# If the rule doesn't exist, the error doesn't interrupt the build process. +make examples + +if [ ! -d "snooty-parser" ]; then + echo "snooty parser not installed, downloading..." + curl -L -o snooty-parser.zip https://github.com/mongodb/snooty-parser/releases/download/v${PARSER_VERSION}/snooty-v${PARSER_VERSION}-linux_x86_64.zip + unzip -d ./snooty-parser snooty-parser.zip + chmod +x ./snooty-parser/snooty +fi + +echo "=======================================================================================================================================================================" +echo "========================================================================== Running parser... ==========================================================================" +./snooty-parser/snooty/snooty build . --no-caching --output=./bundle.zip +echo "========================================================================== Parser complete ============================================================================" +echo "=======================================================================================================================================================================" + +if [ ! -d "snooty" ]; then + echo "snooty frontend not installed, downloading" + git clone -b netlify-poc --depth 1 https://github.com/mongodb/snooty.git + echo GATSBY_MANIFEST_PATH=$(pwd)/bundle.zip >> ./snooty/.env.production + cd snooty + npm ci --legacy-peer-deps + git clone --depth 1 https://github.com/mongodb/docs-tools.git ./snooty/docs-tools + mkdir -p ./snooty/static/images + mv ./snooty/docs-tools/themes/mongodb/static ./static/docs-tools + mv ./snooty/docs-tools/themes/guides/static/images/bg-accent.svg ./static/docs-tools/images/bg-accent.svg +fi + +if [ -d "docs-worker-pool" ]; then + node --unhandled-rejections=strict docs-worker-pool/modules/persistence/dist/index.js --path bundle.zip --githubUser netlify +fi + + +cd snooty && npm run build:no-prefix From 393d832c24349e2d505c782a2bf4ed0c0a0da35e Mon Sep 17 00:00:00 2001 From: Brandon Ly Date: Fri, 7 Feb 2025 13:38:29 -0500 Subject: [PATCH 02/17] Update build.sh --- build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index d69b38e9d..5edeb8698 100644 --- a/build.sh +++ b/build.sh @@ -1,5 +1,5 @@ -PARSER_VERSION=0.18.12 - +PARSER_VERSION=0.18.13 +BRANCH = $(shell printenv BRANCH) # This make command curls the examples for certain repos. # If the rule doesn't exist, the error doesn't interrupt the build process. make examples @@ -13,7 +13,7 @@ fi echo "=======================================================================================================================================================================" echo "========================================================================== Running parser... ==========================================================================" -./snooty-parser/snooty/snooty build . --no-caching --output=./bundle.zip +./snooty-parser/snooty/snooty build . --no-caching --output=./bundle.zip --branch=${BRANCH} echo "========================================================================== Parser complete ============================================================================" echo "=======================================================================================================================================================================" From 18945ea03b6734c02dd92f230875dbbb96418dd1 Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Fri, 7 Feb 2025 13:17:20 -0800 Subject: [PATCH 03/17] Update build.sh --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 5edeb8698..848d4b6f5 100644 --- a/build.sh +++ b/build.sh @@ -19,7 +19,7 @@ echo "========================================================================== if [ ! -d "snooty" ]; then echo "snooty frontend not installed, downloading" - git clone -b netlify-poc --depth 1 https://github.com/mongodb/snooty.git + git clone -b netlify-pageId-hotfix --depth 1 https://github.com/mongodb/snooty.git echo GATSBY_MANIFEST_PATH=$(pwd)/bundle.zip >> ./snooty/.env.production cd snooty npm ci --legacy-peer-deps From 7c1f59590aec761f4ebe8a6c0d6d494e38cc8bdf Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Fri, 7 Feb 2025 13:32:54 -0800 Subject: [PATCH 04/17] Remove branch flag from parser --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 848d4b6f5..56e454e1a 100644 --- a/build.sh +++ b/build.sh @@ -13,7 +13,7 @@ fi echo "=======================================================================================================================================================================" echo "========================================================================== Running parser... ==========================================================================" -./snooty-parser/snooty/snooty build . --no-caching --output=./bundle.zip --branch=${BRANCH} +./snooty-parser/snooty/snooty build . --no-caching --output=./bundle.zip echo "========================================================================== Parser complete ============================================================================" echo "=======================================================================================================================================================================" From 6398c73b297d57808b849eb083bfb962d242e53c Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Fri, 7 Feb 2025 13:33:58 -0800 Subject: [PATCH 05/17] Add branch for parser flag --- build.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 56e454e1a..9812ac04b 100644 --- a/build.sh +++ b/build.sh @@ -1,5 +1,4 @@ PARSER_VERSION=0.18.13 -BRANCH = $(shell printenv BRANCH) # This make command curls the examples for certain repos. # If the rule doesn't exist, the error doesn't interrupt the build process. make examples @@ -13,7 +12,7 @@ fi echo "=======================================================================================================================================================================" echo "========================================================================== Running parser... ==========================================================================" -./snooty-parser/snooty/snooty build . --no-caching --output=./bundle.zip +./snooty-parser/snooty/snooty build . --no-caching --output=./bundle.zip --branch="master" echo "========================================================================== Parser complete ============================================================================" echo "=======================================================================================================================================================================" From 10e664f3cdc3085469d1b04b5f8c6cb000334106 Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Fri, 7 Feb 2025 13:53:39 -0800 Subject: [PATCH 06/17] Update build.sh --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 9812ac04b..2fc98058e 100644 --- a/build.sh +++ b/build.sh @@ -12,7 +12,7 @@ fi echo "=======================================================================================================================================================================" echo "========================================================================== Running parser... ==========================================================================" -./snooty-parser/snooty/snooty build . --no-caching --output=./bundle.zip --branch="master" +./snooty-parser/snooty/snooty build . --no-caching --output=./bundle.zip echo "========================================================================== Parser complete ============================================================================" echo "=======================================================================================================================================================================" From cfdefb9f5fd4ac6a39676610633812cf08e19f8e Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Mon, 10 Feb 2025 08:32:38 -0800 Subject: [PATCH 07/17] add branch flag --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 2fc98058e..42e74635e 100644 --- a/build.sh +++ b/build.sh @@ -12,7 +12,7 @@ fi echo "=======================================================================================================================================================================" echo "========================================================================== Running parser... ==========================================================================" -./snooty-parser/snooty/snooty build . --no-caching --output=./bundle.zip +./snooty-parser/snooty/snooty build . --no-caching --output=./bundle.zip --branch=master echo "========================================================================== Parser complete ============================================================================" echo "=======================================================================================================================================================================" From 7e8b5e45e80d519b5f9a6250c4261c52f77d8166 Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Mon, 10 Feb 2025 10:05:41 -0800 Subject: [PATCH 08/17] Update build.sh parser version to 0.18.14 --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 42e74635e..a77bede97 100644 --- a/build.sh +++ b/build.sh @@ -1,4 +1,4 @@ -PARSER_VERSION=0.18.13 +PARSER_VERSION=0.18.14 # This make command curls the examples for certain repos. # If the rule doesn't exist, the error doesn't interrupt the build process. make examples From b224eca4c03797611319bf30b03756e604ba686c Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Mon, 10 Feb 2025 12:39:32 -0800 Subject: [PATCH 09/17] Add BRANCH_NAME as argument to netlify.toml --- netlify.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netlify.toml b/netlify.toml index d0c890406..7ca7ef4e9 100644 --- a/netlify.toml +++ b/netlify.toml @@ -3,4 +3,4 @@ name = "snooty-cache-plugin" [build] publish = "snooty/public" -command = ". ./build.sh" +command = ". ./build.sh $BRANCH_NAME" From ba1944fd396c9372ac14d81cfc24eeda68bff7fc Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Mon, 10 Feb 2025 12:44:02 -0800 Subject: [PATCH 10/17] Update build.sh to print branch name --- build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.sh b/build.sh index a77bede97..dfd72c74e 100644 --- a/build.sh +++ b/build.sh @@ -2,6 +2,8 @@ PARSER_VERSION=0.18.14 # This make command curls the examples for certain repos. # If the rule doesn't exist, the error doesn't interrupt the build process. make examples +BRANCH_NAME=$1 +echo "Printing branch name ${BRANCH_NAME}" if [ ! -d "snooty-parser" ]; then echo "snooty parser not installed, downloading..." From 4e23f31616c521434c1c4e12affefb1f46a09f8b Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Mon, 10 Feb 2025 13:57:04 -0800 Subject: [PATCH 11/17] Update netlify.toml to remove branch name as an argument --- netlify.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netlify.toml b/netlify.toml index 7ca7ef4e9..fdc70b72c 100644 --- a/netlify.toml +++ b/netlify.toml @@ -3,4 +3,4 @@ name = "snooty-cache-plugin" [build] publish = "snooty/public" -command = ". ./build.sh $BRANCH_NAME" +command = ". ./build.sh" From 39483e70b7be28e507b57cabcbdbc96a4a705fdf Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Mon, 10 Feb 2025 13:57:25 -0800 Subject: [PATCH 12/17] Update build.sh --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index dfd72c74e..37348a74c 100644 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ PARSER_VERSION=0.18.14 # This make command curls the examples for certain repos. # If the rule doesn't exist, the error doesn't interrupt the build process. make examples -BRANCH_NAME=$1 + echo "Printing branch name ${BRANCH_NAME}" if [ ! -d "snooty-parser" ]; then From 3a177c94dcb55aa80683146aa369c87158ec3cbc Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Mon, 10 Feb 2025 13:58:13 -0800 Subject: [PATCH 13/17] Update build.sh --- build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.sh b/build.sh index 37348a74c..54e7178f0 100644 --- a/build.sh +++ b/build.sh @@ -4,6 +4,8 @@ PARSER_VERSION=0.18.14 make examples echo "Printing branch name ${BRANCH_NAME}" +BRANCH=git branch +echo " branch using git branch ${BRANCH}" if [ ! -d "snooty-parser" ]; then echo "snooty parser not installed, downloading..." From 2723efd438b303e412de33af76882df84a0b3bd3 Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Mon, 10 Feb 2025 14:04:32 -0800 Subject: [PATCH 14/17] Update build.sh --- build.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 54e7178f0..43d5b6634 100644 --- a/build.sh +++ b/build.sh @@ -4,8 +4,7 @@ PARSER_VERSION=0.18.14 make examples echo "Printing branch name ${BRANCH_NAME}" -BRANCH=git branch -echo " branch using git branch ${BRANCH}" +echo "branch using git branch ${BRANCH}" if [ ! -d "snooty-parser" ]; then echo "snooty parser not installed, downloading..." From 10b5c9330921888383caf9ee6dd7a98e630427c5 Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Mon, 10 Feb 2025 14:40:08 -0800 Subject: [PATCH 15/17] Update build.sh --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 43d5b6634..49c19a597 100644 --- a/build.sh +++ b/build.sh @@ -15,7 +15,7 @@ fi echo "=======================================================================================================================================================================" echo "========================================================================== Running parser... ==========================================================================" -./snooty-parser/snooty/snooty build . --no-caching --output=./bundle.zip --branch=master +./snooty-parser/snooty/snooty build . --no-caching --output=./bundle.zip --branch=BRANCH_NAME echo "========================================================================== Parser complete ============================================================================" echo "=======================================================================================================================================================================" From 4b440ceabc2eb8ffda15452f21e5c8e865bbbf83 Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Mon, 10 Feb 2025 14:43:27 -0800 Subject: [PATCH 16/17] Update build.sh --- build.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 49c19a597..c0cbbe51b 100644 --- a/build.sh +++ b/build.sh @@ -6,6 +6,9 @@ make examples echo "Printing branch name ${BRANCH_NAME}" echo "branch using git branch ${BRANCH}" +git rev-parse --abbrev-ref HEAD >> TEST_VAL +echo "testing val ${TEST_VAL}" + if [ ! -d "snooty-parser" ]; then echo "snooty parser not installed, downloading..." curl -L -o snooty-parser.zip https://github.com/mongodb/snooty-parser/releases/download/v${PARSER_VERSION}/snooty-v${PARSER_VERSION}-linux_x86_64.zip @@ -15,7 +18,7 @@ fi echo "=======================================================================================================================================================================" echo "========================================================================== Running parser... ==========================================================================" -./snooty-parser/snooty/snooty build . --no-caching --output=./bundle.zip --branch=BRANCH_NAME +./snooty-parser/snooty/snooty build . --no-caching --output=./bundle.zip --branch="BRANCH_NAME" echo "========================================================================== Parser complete ============================================================================" echo "=======================================================================================================================================================================" From 78476c638341e63fb195af672c598c5c6be7a256 Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Mon, 10 Feb 2025 14:47:20 -0800 Subject: [PATCH 17/17] Update build.sh --- build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index c0cbbe51b..b48b1f5ba 100644 --- a/build.sh +++ b/build.sh @@ -6,7 +6,7 @@ make examples echo "Printing branch name ${BRANCH_NAME}" echo "branch using git branch ${BRANCH}" -git rev-parse --abbrev-ref HEAD >> TEST_VAL +TEST_VAL=git rev-parse --abbrev-ref HEAD echo "testing val ${TEST_VAL}" if [ ! -d "snooty-parser" ]; then @@ -18,7 +18,7 @@ fi echo "=======================================================================================================================================================================" echo "========================================================================== Running parser... ==========================================================================" -./snooty-parser/snooty/snooty build . --no-caching --output=./bundle.zip --branch="BRANCH_NAME" +./snooty-parser/snooty/snooty build . --no-caching --output=./bundle.zip --branch="${BRANCH_NAME}" echo "========================================================================== Parser complete ============================================================================" echo "======================================================================================================================================================================="