Commit 6c8d1727 authored by Matthieu Muffato's avatar Matthieu Muffato
Browse files

Properly handle RTD (i.e. multi-stage runs vs reruns) and only rebuild Doxygen when needed

parent 10e84c00
......@@ -84,7 +84,7 @@ version = re.sub('^(heads|remotes/origin)/', '', os.popen('git describe --all').
release = version + '/' + os.popen('git rev-parse --short HEAD').read().strip()
doxygen_target = setup_if_needed()
doxygen_target = setup_if_needed(release)
doxylink = {
'doxehive': (os.path.join(doxygen_target, "ensembl-hive.tag"), 'perl/'),
}
......
#!/bin/bash
# Bail out if anything goes wrong
set -e
# $PWD is the user manual, which I want to keep clean
cd "$HOME"
# Exit if we have already installed the dependencies
[ -d packages ] && exit 0;
rm -f *.deb
# List of extra packages we need
echo http://archive.ubuntu.com/ubuntu/pool/main/libd/libdbi-perl/libdbi-perl_1.634-1build1_amd64.deb \
http://archive.ubuntu.com/ubuntu/pool/universe/libd/libdbd-sqlite3-perl/libdbd-sqlite3-perl_1.50-1_amd64.deb \
......@@ -24,8 +23,10 @@ echo http://archive.ubuntu.com/ubuntu/pool/main/libd/libdbi-perl/libdbi-perl_1.6
http://archive.ubuntu.com/ubuntu/pool/universe/libp/libproc-daemon-perl/libproc-daemon-perl_0.23-1_all.deb \
| xargs -n 1 curl -O
rm -rf packages
mkdir packages
for i in *.deb; do dpkg -x "$i" packages/; done
rm -rf ensembl
git clone --branch master --depth 1 https://github.com/Ensembl/ensembl.git
......@@ -5,13 +5,23 @@ import subprocess
import sys
def setup_if_needed():
def setup_if_needed(this_release):
build_path = os.path.join(os.environ["PWD"], "_build")
# Check whether we are on the same version of eHive
is_same = False
release_holder = os.path.join(build_path, "LAST_BUILD")
if os.path.isfile(release_holder):
with open(release_holder, "r") as fh:
previous_release = fh.read()
if previous_release == this_release:
is_same = True
# Install packages and setup environment
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
if on_rtd:
subprocess.check_call([os.environ["PWD"] + os.path.sep + "rtd_upgrade.sh"], stdout=sys.stdout, stderr=sys.stderr)
if not is_same:
subprocess.check_call(["./rtd_upgrade.sh"], stdout=sys.stdout, stderr=sys.stderr)
upgrade_path = os.environ["HOME"]
deb_install_path = os.path.join(upgrade_path, "packages")
os.environ["PERL5LIB"] = os.path.pathsep.join(os.path.join(deb_install_path, _) for _ in ["usr/share/perl5/", "usr/lib/x86_64-linux-gnu/perl5/5.22/", "usr/lib/x86_64-linux-gnu/perl5/5.22/auto/"])
......@@ -26,8 +36,11 @@ def setup_if_needed():
mkdoxygen_path = os.path.join(os.environ["EHIVE_ROOT_DIR"], "scripts", "dev", "make_doxygen.pl")
# Only run doxygen if it's missing
doxygen_target = os.path.join(build_path, "doxygen")
if on_rtd or any(not os.path.exists(os.path.join(doxygen_target, _)) for _ in ["perl", "python3", "java"]):
if (on_rtd and not is_same) or any(not os.path.exists(os.path.join(doxygen_target, _)) for _ in ["perl", "python3", "java"]):
subprocess.check_call([mkdoxygen_path, doxygen_target])
with open(release_holder, "w") as fh:
print >> fh, this_release,
return doxygen_target
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment