Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOP-5025: Allow Snooty Staging with Netlify #1246

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
96638bd
testing build stuff
biancalaube Sep 17, 2024
7db4139
new env variables
biancalaube Sep 17, 2024
78d9b0e
add build
biancalaube Sep 17, 2024
918dcba
add build new
biancalaube Sep 17, 2024
0c84d84
add build new 2
biancalaube Sep 17, 2024
65d4c48
testing something
biancalaube Sep 18, 2024
6d6a850
testing something
biancalaube Sep 18, 2024
387e3a9
testing something
biancalaube Sep 18, 2024
1acf7f9
testing something
biancalaube Sep 18, 2024
a9e6248
updated toml file
biancalaube Sep 18, 2024
60bd3da
updated toml file new
biancalaube Sep 18, 2024
615d926
no prefix
biancalaube Sep 18, 2024
43de8bd
updated package json
biancalaube Sep 18, 2024
0a398c6
updated
biancalaube Sep 18, 2024
4348cbf
updated
biancalaube Sep 18, 2024
10df5bc
Update netlify.toml
branberry Sep 18, 2024
2f151e3
Merge branch 'main' into DOP-5025
branberry Sep 18, 2024
ce4f396
Update package.json
branberry Sep 18, 2024
77db433
trying new base
biancalaube Sep 19, 2024
4792936
new base
biancalaube Sep 19, 2024
90025fc
trying something
biancalaube Sep 19, 2024
3046605
trying something
biancalaube Sep 19, 2024
a3b70e6
trying something new
biancalaube Sep 19, 2024
c7d9734
new build
biancalaube Sep 19, 2024
b12089e
new change
biancalaube Sep 19, 2024
adeb0d5
trying a variable
biancalaube Sep 19, 2024
a0b1510
new clone link
biancalaube Sep 19, 2024
0332fce
cleaned up build.sh file
biancalaube Sep 19, 2024
652efbb
package updates
biancalaube Sep 19, 2024
999c86e
update parser version
biancalaube Sep 19, 2024
9b01684
update echo
biancalaube Sep 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ coverage/
.lighthouseci/links.json
.vscode/
.env
.swc/
.swc/
bundle.zip
35 changes: 35 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# variables that need to be changed based on the content repo you're working on -------------------------------------------
TESTING_CONTENT_REPO=docs-landing # name of content repo
ORGANIZATION=mongodb # name of org, usually mongodb or 10gen
# -------------------------------------------------------------------------------------------------------------------------
PARSER_VERSION=0.18.0

# 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 - we don't need this for docs-landing, but have it here for when we change repos

# cloning the content repo
echo "cloning content repo: ${TESTING_CONTENT_REPO}"
git clone https://github.com/${ORGANIZATION}/${TESTING_CONTENT_REPO}.git


# running the parser
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 $(pwd)/${TESTING_CONTENT_REPO} --output=./bundle.zip
echo "========================================================================== Parser complete ============================================================================"
echo "======================================================================================================================================================================="

# putting set conent-repo as the path
echo GATSBY_MANIFEST_PATH=$(pwd)/bundle.zip
export GATSBY_MANIFEST_PATH=$(pwd)/bundle.zip

# run the site
npm run build:no-prefix
6 changes: 6 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[[integrations]]
name = "snooty-cache-plugin"

[build]
publish = "public"
command = ". ./build.sh"
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"build:clean": "npm run clean && npm run build",
"build:clean:stage": "npm run build:clean && make stage",
"build:netlify": "npm run build && echo -n $INCOMING_HOOK_BODY > build-hook.txt",
"build:no-prefix": "gatsby build",
"clean": "gatsby clean",
"develop": "gatsby develop",
"develop:preview": "GATSBY_IS_PREVIEW=true gatsby develop",
Expand Down
Loading