Skip to content

Commit 6e52c2a

Browse files
Update build.sh
1 parent edb5169 commit 6e52c2a

File tree

1 file changed

+40
-5
lines changed

1 file changed

+40
-5
lines changed

build.sh

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,43 @@
11
# ensures that we always use the latest version of the script
2-
if [ -f build-site.sh ]; then
3-
rm build-site.sh
4-
fi
2+
PARSER_VERSION=0.18.16
53

4+
# This make command curls the examples for certain repos.
5+
# If the rule doesn't exist, the error doesn't interrupt the build process.
6+
echo "ls everything"
7+
ls
68

7-
curl https://raw.githubusercontent.com/mongodb/docs-worker-pool/netlify-poc/scripts/build-site.sh -o build-site.sh
8-
sh build-site.sh
9+
make examples
10+
11+
if [ ! -d "snooty-parser" ]; then
12+
echo "Snooty parser not installed, downloading..."
13+
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
14+
unzip -d ./snooty-parser snooty-parser.zip
15+
chmod +x ./snooty-parser/snooty
16+
fi
17+
18+
echo "======================================================================================================================================================================="
19+
echo "========================================================================== Running parser... =========================================================================="
20+
./snooty-parser/snooty/snooty build . --no-caching --output=./bundle.zip --branch=${BRANCH_NAME}
21+
echo "========================================================================== Parser complete ============================================================================"
22+
echo "======================================================================================================================================================================="
23+
24+
if [ ! -d "snooty" ]; then
25+
echo "Snooty frontend not installed, downloading"
26+
git clone -b netlify-poc --depth 1 https://github.com/mongodb/snooty.git
27+
echo GATSBY_MANIFEST_PATH=$(pwd)/bundle.zip >> ./snooty/.env.production
28+
cd snooty
29+
npm ci --legacy-peer-deps
30+
git clone --depth 1 https://github.com/mongodb/docs-tools.git ./snooty/docs-tools
31+
mkdir -p ./snooty/static/images
32+
mv ./snooty/docs-tools/themes/mongodb/static ./static/docs-tools
33+
mv ./snooty/docs-tools/themes/guides/static/images/bg-accent.svg ./static/docs-tools/images/bg-accent.svg
34+
fi
35+
36+
37+
if [ -d "docs-worker-pool" ]; then
38+
echo "Running persistence module"
39+
node --unhandled-rejections=strict docs-worker-pool/modules/persistence/dist/index.js --path bundle.zip --githubUser netlify
40+
fi
41+
42+
43+
cd snooty && npm run build:no-prefix

0 commit comments

Comments
 (0)