Skip to content
Snippets Groups Projects
Commit 358acc90 authored by T Jubb's avatar T Jubb
Browse files

Refs #22930 merge master.

parents 554d8ca5 4eaf7ed8
No related branches found
No related tags found
No related merge requests found
...@@ -9,64 +9,51 @@ if [ -z "$BUILD_DIR" ]; then ...@@ -9,64 +9,51 @@ if [ -z "$BUILD_DIR" ]; then
echo "Setting BUILD_DIR to $BUILD_DIR" echo "Setting BUILD_DIR to $BUILD_DIR"
fi fi
###############################################################################
# Set up the build directory
###############################################################################
if [ -d $BUILD_DIR ]; then if [ -d $BUILD_DIR ]; then
echo "$BUILD_DIR exists" echo "$BUILD_DIR exists - updating existing checkout"
cd $BUILD_DIR
git pull --rebase
else else
mkdir $BUILD_DIR echo "$BUILD_DIR does not exist - cloning developer site"
git clone -b gh-pages git@github.com-mantid-builder:mantidproject/developer.git $BUILD_DIR || exit -1
cd $BUILD_DIR
fi fi
############################################################################### ###############################################################################
# Print out the versions of things we are using # Setup virtualenv for building the docs
############################################################################### ###############################################################################
# we use cmake3 on rhel because cmake is too old VIRTUAL_ENV=$BUILD_DIR/virtualenv
if [ $(command -v cmake3) ]; then if [[ ! -d $VIRTUAL_ENV ]]; then
CMAKE_EXE=cmake3 virtualenv --system-site-packages "$VIRTUAL_ENV"
source $VIRTUAL_ENV/bin/activate
pip install sphinx
pip install sphinx_bootstrap_theme
else else
CMAKE_EXE=cmake source $VIRTUAL_ENV/bin/activate
fi fi
${CMAKE_EXE} --version which python
############################################################################### ###############################################################################
# Generator # Build the developer site
# -----------------------------------------------------------------------------
# the wacky long line is what is run from inside "sphinx-build" which is not
# installed by virtualenv for some reason
############################################################################### ###############################################################################
if [ "$(command -v ninja)" ]; then SPHINX_VERS=$(python -c "import sphinx;print sphinx.__version__")
CMAKE_GENERATOR="-G Ninja" python -c "import sys;from pkg_resources import load_entry_point;sys.exit(load_entry_point('Sphinx==$SPHINX_VERS', 'console_scripts', 'sphinx-build')())" $WORKSPACE/dev-docs/source $BUILD_DIR
elif [ "$(command -v ninja-build)" ]; then
CMAKE_GENERATOR="-G Ninja"
fi
##### set up the build directory
cd $BUILD_DIR
if [ -e $BUILD_DIR/CMakeCache.txt ]; then
${CMAKE_EXE} .
else
${CMAKE_EXE} ${CMAKE_GENERATOR} ..
fi
if [ -d dev-docs/html ]; then
echo "Updating existing checkout"
cd dev-docs/html
git pull --rebase
cd -
else
echo "Cloning developer site"
git clone git@github.com:mantidproject/developer.git dev-docs/html || exit -1
cd dev-docs/html
git checkout gh-pages
cd -
fi
##### build the developer site
${CMAKE_EXE} --build . --target dev-docs-html
cd dev-docs/html
###############################################################################
# Push the results
###############################################################################
if [ "builder" == "$USER" ]; then if [ "builder" == "$USER" ]; then
echo "Setting username" echo "Setting username"
git config user.name mantid-builder git config user.name mantid-builder
git config user.email "mantid-buildserver@mantidproject.org" git config user.email "mantid-buildserver@mantidproject.org"
fi fi
##### push the results
if [ $(git diff --quiet) ]; then if [ $(git diff --quiet) ]; then
echo "Committing new site" echo "Committing new site"
git add . git add .
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment