-
Notifications
You must be signed in to change notification settings - Fork 36
/
build.sh
32 lines (27 loc) · 1.89 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# variables that need to be changed based on the content repo you're working on -------------------------------------------
TESTING_REPO_NAME=$1 # name of content repo
PARSER_VERSION=$2 # version of the parser to download
# -------------------------------------------------------------------------------------------------------------------------
# Check that content repo has been successfully cloned
if [ -d "${TESTING_REPO_NAME}" ]; then
echo "Directory ${TESTING_REPO_NAME} exists"
else
echo "Content repository directory for ${TESTING_REPO_NAME} does not exist, parse and build will fail"
fi
# running the parser
if [ ! -d "snooty-parser" ]; then
echo "Snooty parser not installed, downloading parser version $PARSER_VERSION ..."
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_REPO_NAME} --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