-
Notifications
You must be signed in to change notification settings - Fork 22
/
publish-docs
executable file
·33 lines (26 loc) · 1.13 KB
/
publish-docs
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
33
#!/bin/bash
if [[ -z $1 || $# -gt 1 ]]; then
echo "Usage: publish-docs <version>"
exit 1
fi
version=$1
baseDir=`pwd`
dirName=`basename ${baseDir}`
if [ ! ${dirName} = "docs-java-other" ]
then
echo "Please run this script from the docs-java-other directory."
exit 1
fi
submoduleName="mongo-java-driver"
referenceDir="reference"
landingDir="landing"
echo "Adding mongo-java-driver submodule (if necessary)..."
git submodule add -b gh-pages https://github.com/mongodb/mongo-java-driver.git 2> /dev/null && git submodule update --init --recursive --remote
# make the reference docs
echo "[START] Building reference docs version: ${version}"
hugo --config ${referenceDir}/config.toml --source ${referenceDir} --destination ${baseDir}/${submoduleName}/${version} && echo "[COMPLETE] Completed reference docs build."
# make the landing page docs
echo "[START] Building landing page docs"
hugo --config ${landingDir}/config.toml --source ${landingDir} --destination ${baseDir}/${submoduleName}/ && echo "[COMPLETE] Completed landing page docs build."
# publish the docs
# you will need push access to the mongo-java-driver repo's gh-pages branch