diff --git a/.travis.yml b/.travis.yml index d8054087366e9f29c308a2fc2e73fd2d33b9f61b..b9ec906e73f428ac9ab8bb514f0d300356e07960 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ addons: deploy: provider: pages target-branch: gh-pages - local-dir: docs/build + local-dir: docs/webroot skip-cleanup: true github-token: $GITHUB_TOKEN # Set in travis-ci.org dashboard, marked secure keep-history: true diff --git a/build_and_deploy.sh b/build_and_deploy.sh index 4abeb2f926b549d7d3c3b1db78813c8a0d07ee09..a6a794b046b76bb22f8bf2db07dfc46ea9c2345b 100755 --- a/build_and_deploy.sh +++ b/build_and_deploy.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex set -e # Exit with nonzero exit code if anything fails # Then we build and deploy the sphinx / doxygen documentation @@ -16,43 +16,5 @@ fi #SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:} #SHA=`git rev-parse --verify HEAD` -# Change working directory to /docs -cd docs # ..................................... now we're in /docs - - -############################# DOXYGEN ######################################## - - -cd doxygen # ..................................... now we're in /docs/doxygen - -# create temporary clone of MFiX-Exa SOURCE_BRANCH -git clone https://gitlab-ci-token:$GITLAB_TOKEN@mfix.netl.doe.gov/gitlab/exa/mfix.git - -# build the Doxygen documentation -doxygen doxygen.conf - -cd .. # ..................................... now we're in /docs - -# move it to the deploy directory: /docs/build -mkdir build -mv doxygen/html build/doxygen - - -############################# SPHINX ######################################## - - -# now do sphinx -make html -cd build # ..................................... now we're in /docs/build -mv html docs_html - - -############################# WEB SERVER STUFF ################################ - - -# Sphinx is set up to treat build/html (and by mv, build/docs_html) as the -# webroot. Hence the .nojekyll file is in the wrong place -mv docs_html/.nojekyll . - -# PWD is currently /docs/build, we want to move /docs/webroot into /docs/build -mv ../webroot/* . +# build Doxygen docs and Sphinx docs +make -C docs diff --git a/docs/Makefile b/docs/Makefile index 8422dc9b04f1f5207ee2ce7cb8277a2461aff0d1..f97de82c48bfff14d8983d69c989d354d6d5ab28 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -6,9 +6,14 @@ SPHINXOPTS = SPHINXBUILD = python -msphinx SPHINXPROJ = amrex SOURCEDIR = source -BUILDDIR = build +BUILDDIR = webroot + +all: html webroot/doxygen + mv webroot/html webroot/docs_html +# Sphinx is set up to treat its build directory as the webroot, hence the +# .nojekyll file is in the wrong place + mv webroot/docs_html/.nojekyll webroot -# Put it first so that "make" without argument is like "make help". help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) @@ -17,4 +22,9 @@ help: # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +webroot/doxygen: + git clone https://gitlab-ci-token:$GITLAB_TOKEN@mfix.netl.doe.gov/gitlab/exa/mfix.git doxygen/mfix + cd doxygen && doxygen doxygen.conf + mv doxygen/html $@