mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Test docs before deploying (#7992)
* Test docs before deploying fix issue with docs * Actually check the result of the doc build add error for testing * Fix up docs * use original logic * only deploy docs if build succeeds. Make pip quiet
This commit is contained in:
@@ -3,10 +3,15 @@ GH_REPO="@github.com/librenms-docs/librenms-docs.github.io.git"
|
||||
FULL_REPO="https://${GH_TOKEN}$GH_REPO"
|
||||
THEME_REPO="https://github.com/librenms-docs/theme_v2.git"
|
||||
|
||||
pip install --user 'jinja2<2.9'
|
||||
pip install --user mkdocs
|
||||
pip install --user pymdown-extensions
|
||||
pip install --user git+git://github.com/aleray/mdx_del_ins.git
|
||||
if [ "$EXECUTE_BUILD_DOCS" != "true" ]; then
|
||||
echo "Doc build skipped"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
pip install --user --quiet 'jinja2<2.9'
|
||||
pip install --user --quiet mkdocs
|
||||
pip install --user --quiet pymdown-extensions
|
||||
pip install --user --quiet git+git://github.com/aleray/mdx_del_ins.git
|
||||
|
||||
mkdir -p out
|
||||
|
||||
@@ -24,10 +29,16 @@ cd ../
|
||||
git clone $THEME_REPO
|
||||
|
||||
mkdocs build --clean
|
||||
build_result=$?
|
||||
|
||||
cd out
|
||||
# Only deploy after merging to master
|
||||
if [ "$build_result" == "0" -a "$TRAVIS_PULL_REQUEST" == "false" -a "$TRAVIS_BRANCH" == "master" ]; then
|
||||
cd out
|
||||
|
||||
touch .
|
||||
git add -A .
|
||||
git commit -m "GH-Pages update by travis after $TRAVIS_COMMIT"
|
||||
git push -q origin master
|
||||
touch .
|
||||
git add -A .
|
||||
git commit -m "GH-Pages update by travis after $TRAVIS_COMMIT"
|
||||
git push -q origin master
|
||||
else
|
||||
exit ${build_result} # return doc build result
|
||||
fi
|
||||
|
Reference in New Issue
Block a user