diff options
author | Sol Jerome <sol.jerome@gmail.com> | 2017-08-18 15:01:32 -0500 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2017-08-18 15:01:32 -0500 |
commit | e193079d1779e4d66d80882e6f1c3ff9ba05619b (patch) | |
tree | b47f262f3b7d57a1ddeefd0f2aeba3bb35539d18 /testsuite/install.sh | |
parent | cd0f5f5f62376f7dc64e5c5c7d59a7c6bfcb918f (diff) | |
parent | 0fdabbcb4668d5f70f76c08a6e3216c5542e7457 (diff) | |
download | bcfg2-e193079d1779e4d66d80882e6f1c3ff9ba05619b.tar.gz bcfg2-e193079d1779e4d66d80882e6f1c3ff9ba05619b.tar.bz2 bcfg2-e193079d1779e4d66d80882e6f1c3ff9ba05619b.zip |
Merge branch 'feature/travis-container' of https://github.com/AlexanderS/bcfg2
Diffstat (limited to 'testsuite/install.sh')
-rwxr-xr-x | testsuite/install.sh | 80 |
1 files changed, 63 insertions, 17 deletions
diff --git a/testsuite/install.sh b/testsuite/install.sh index 4d8778ad7..af07de0a9 100755 --- a/testsuite/install.sh +++ b/testsuite/install.sh @@ -1,31 +1,77 @@ #!/bin/bash -ex # install script for Travis-CI +PYVER=$(python -c 'import sys;print(".".join(str(v) for v in sys.version_info[0:2]))') +SITE_PACKAGES=$(python -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())') -sudo apt-get update -qq -sudo apt-get install swig libxml2-utils - -pip install -r testsuite/requirements.txt +if [[ ${PYVER:0:1} == "2" && $PYVER != "2.7" && $PYVER != "2.6" ]]; then + pip install -r testsuite/requirements-legacy.txt +else + pip install --upgrade pip -PYVER=$(python -c 'import sys;print(".".join(str(v) for v in sys.version_info[0:2]))') + pip_wheel() { + pip wheel --find-links="$HOME/.cache/wheels/" --wheel-dir="$HOME/.cache/wheels/" "$@" + pip install --no-index --find-links="$HOME/.cache/wheels/" "$@" + } -if [[ ${PYVER:0:1} == "2" && $PYVER != "2.7" ]]; then - pip install unittest2 -fi + if [[ $PYVER == "2.6" ]]; then + pip_wheel -r testsuite/requirements-26.txt + pip_wheel unittest2 + else + pip_wheel -r testsuite/requirements.txt -if [[ "$WITH_OPTIONAL_DEPS" == "yes" ]]; then - sudo apt-get install -y yum libaugeas0 augeas-lenses libacl1-dev libssl-dev \ - python-gamin python-selinux + if [[ ${PYVER:0:1} == "3" ]]; then + # TODO: Move to "requirements.txt" if all the new errors are fixed. + pip_wheel 'pylint>1.4' + fi + fi - pip install PyYAML pyinotify boto pylibacl Jinja2 mercurial guppy cherrypy python-augeas + if [[ "$WITH_OPTIONAL_DEPS" == "yes" ]]; then + pip_wheel PyYAML pyinotify boto pylibacl Jinja2 \ + cherrypy python-augeas nose-show-skipped - if [[ ${PYVER:0:1} == "2" ]]; then - pip install cheetah m2crypto + if [[ $PYVER == "2.6" ]]; then + pip install \ + --global-option='build_ext' \ + --global-option='--include-dirs=/usr/include/x86_64-linux-gnu' \ + m2crypto - if [[ $PYVER != "2.7" ]]; then - pip install 'django<1.7' 'South<0.8' + pip_wheel 'django<1.7' 'South<0.8' 'mercurial<4.3' cheetah guppy else - pip install django + if [[ $PYVER == "2.7" ]]; then + pip_wheel m2crypto guppy + fi + + pip_wheel django mercurial cheetah3 fi fi fi + +# Use system site-packages and pymodules +if [[ "$WITH_SYSTEM_SITE_PACKAGES" == "yes" ]]; then + cat <<EOF > "$SITE_PACKAGES/system-packages.pth" +/usr/lib/python$PYVER/site-packages/ +/usr/lib/python$PYVER/dist-packages/ +/usr/lib/pymodules/python$PYVER/ +EOF +fi + +# Setup the local xml schema cache +download_schema() { + if [[ ! -e "$1" ]]; then + wget -O "$1" "$2" + fi +} + +mkdir -p "$HOME/.cache/xml/" +download_schema "$HOME/.cache/xml/XMLSchema.xsd" "http://www.w3.org/2001/XMLSchema.xsd" +download_schema "$HOME/.cache/xml/xml.xsd" "http://www.w3.org/2001/xml.xsd" + +cat > "$HOME/.cache/xml/catalog.xml" <<EOF +<?xml version="1.0"?> +<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"> + <system systemId="http://www.w3.org/2001/XMLSchema.xsd" uri="$HOME/.cache/xml/XMLSchema.xsd" /> + <system systemId="http://www.w3.org/2001/xml.xsd" uri="$HOME/.cache/xml/xml.xsd" /> + <nextCatalog catalog="/etc/xml/catalog.xml" /> +</catalog> +EOF |