Skip to content
Snippets Groups Projects
Commit 46c352e1 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

Merge branch 'staging' into 'master'

Staging

See merge request !42
parents 0b0416e7 ef6057ab
No related branches found
No related tags found
1 merge request!42Staging
#!/usr/bin/env bash #!/usr/bin/env bash
# Sat 24 Sep 08:12:24 2016 CEST # Sat 24 Sep 08:12:24 2016 CEST
source $(dirname ${0})/functions.sh
log_info "*** Not yet implemented ***"
#!/usr/bin/env bash #!/usr/bin/env bash
# Thu 22 Sep 2016 15:11:53 CEST # Thu 22 Sep 2016 15:11:53 CEST
source $(dirname ${0})/functions.sh
log_info "*** Not yet implemented ***"
#!/usr/bin/env bash #!/usr/bin/env bash
# Thu 22 Sep 2016 18:23:57 CEST # Thu 22 Sep 2016 18:23:57 CEST
source $(dirname ${0})/functions.sh
log_info "*** Not yet implemented ***"
#!/usr/bin/env bash #!/usr/bin/env bash
# Thu 22 Sep 2016 13:59:03 CEST # Thu 22 Sep 2016 13:59:03 CEST
source $(dirname ${0})/functions.sh
log_info "*** Not yet implemented ***"
#!/usr/bin/env bash #!/usr/bin/env bash
# Thu 22 Sep 2016 18:23:57 CEST # Thu 22 Sep 2016 18:23:57 CEST
source $(dirname ${0})/functions.sh
log_info "*** Not yet implemented ***"
...@@ -10,27 +10,15 @@ if [ -z "${WHEELS_REPOSITORY}" ]; then ...@@ -10,27 +10,15 @@ if [ -z "${WHEELS_REPOSITORY}" ]; then
fi fi
check_env WHEELS_REPOSITORY check_env WHEELS_REPOSITORY
# Readies the virtualenv to use for installation # Readies a conda environment to use for installation
if [ ! -d ${PREFIX} ]; then if [ ! -d ${PREFIX} ]; then
log_info "Creating virtualenv installation at ${PREFIX}..." log_info "Creating conda installation at ${PREFIX}..."
run_cmd ${BOB_PREFIX_PATH}/bin/virtualenv --system-site-packages ${PREFIX} run_cmd ${CONDA_FOLDER}/bin/conda create --clone ${CONDA_ENV} --prefix ${PREFIX} --yes
else else
log_info "Prefix directory ${PREFIX} exists, not re-installing..." log_info "Prefix directory ${PREFIX} exists, not re-installing..."
fi fi
# Configures CCACHE prepare_build_env ${CONDA_FOLDER} ${PREFIX}
use_ccache=`which ccache`
if [ -z "${use_ccache}" ]; then
log_warn "Cannot find ccache, compiling from scratch..."
else
log_info "ccache installed at ${use_ccache}, caching compilations..."
run_cmd ln -sf ${use_ccache} ${PREFIX}/bin/gcc
run_cmd ln -sf ${use_ccache} ${PREFIX}/bin/g++
fi
# Source the newly created virtualenv
log_info "$ source ${PREFIX}/bin/activate"
source ${PREFIX}/bin/activate
# Verify where pip is installed # Verify where pip is installed
use_pip=`which pip` use_pip=`which pip`
...@@ -41,9 +29,6 @@ else ...@@ -41,9 +29,6 @@ else
log_info "Using pip: ${use_pip}" log_info "Using pip: ${use_pip}"
fi fi
# Upgrade wheel generation library to avoid bugs
run_cmd ${use_pip} install --upgrade setuptools pip wheel
use_python=`which python` use_python=`which python`
if [ -z "${use_python}" ]; then if [ -z "${use_python}" ]; then
log_error "Cannot find python, aborting..." log_error "Cannot find python, aborting..."
...@@ -55,9 +40,15 @@ fi ...@@ -55,9 +40,15 @@ fi
# Install this package's build dependencies # Install this package's build dependencies
PIPOPTS="--find-links ${WHEELS_REPOSITORY}" PIPOPTS="--find-links ${WHEELS_REPOSITORY}"
if [ ! -z "${WHEELS_SERVER}" ]; then if [ ! -z "${WHEELS_SERVER}" ]; then
PIPOPTS="${PIPOPTS} --trusted-host ${WHEELS_SERVER}" PIPOPTS="${PIPOPTS} --trusted-host ${WHEELS_SERVER}"
fi fi
PIPOPTS="${PIPOPTS} --pre --use-wheel --no-index"
# When building a tag, do not use beta wheels
PIPOPTS="${PIPOPTS} --use-wheel --no-index"
if [ -z "${CI_BUILD_TAG}" ]; then
PIPOPTS="${PIPOPTS} --pre"
fi
if [ -e requirements.txt ]; then if [ -e requirements.txt ]; then
run_cmd ${use_pip} install ${PIPOPTS} --requirement requirements.txt run_cmd ${use_pip} install ${PIPOPTS} --requirement requirements.txt
else else
......
#!/usr/bin/env bash #!/usr/bin/env bash
# Thu 22 Sep 2016 18:23:57 CEST # Thu 22 Sep 2016 18:23:57 CEST
source $(dirname ${0})/functions.sh
log_info "*** Not yet implemented ***"
...@@ -5,9 +5,7 @@ source $(dirname ${0})/functions.sh ...@@ -5,9 +5,7 @@ source $(dirname ${0})/functions.sh
run_cmd $(dirname ${0})/before_build.sh run_cmd $(dirname ${0})/before_build.sh
# Source the newly created virtualenv prepare_build_env ${CONDA_FOLDER} ${PREFIX}
log_info "$ source ${PREFIX}/bin/activate"
source ${PREFIX}/bin/activate
# Verify where pip is installed # Verify where pip is installed
use_pip=`which pip` use_pip=`which pip`
......
#!/usr/bin/env bash #!/usr/bin/env bash
# Thu 22 Sep 2016 18:23:57 CEST # Thu 22 Sep 2016 18:23:57 CEST
source $(dirname ${0})/functions.sh
log_info "*** Not yet implemented ***"
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
source $(dirname ${0})/functions.sh source $(dirname ${0})/functions.sh
prepare_build_env ${CONDA_FOLDER} ${PREFIX}
run_cmd ./bin/buildout run_cmd ./bin/buildout
if [ -x ./bin/bob_dbmanage.py ]; then if [ -x ./bin/bob_dbmanage.py ]; then
......
...@@ -176,6 +176,36 @@ doc_upload() { ...@@ -176,6 +176,36 @@ doc_upload() {
} }
# Activates environment and sets up compilation
# $1: root of the conda installation
# $2: your current build prefix
prepare_build_env() {
# Activates conda environment for the build
log_info "$ source $1/bin/activate $2"
source $1/bin/activate $2
# Configures CCACHE
# use_ccache=`which ccache`
# if [ -z "${use_ccache}" ]; then
# log_warn "Cannot find ccache, compiling from scratch..."
# else
# local ccache_bin=$2/lib/ccache
# if [ ! -d ${ccache_bin} ]; then
# run_cmd mkdir -pv ${ccache_bin}
# ln -sf ${use_ccache} ${ccache_bin}/gcc
# ln -sf ${use_ccache} ${ccache_bin}/g++
# ln -sf ${use_ccache} ${ccache_bin}/cc
# ln -sf ${use_ccache} ${ccache_bin}/c++
# fi
# use_gcc=`which gcc`
# PATH=${ccache_bin}:${PATH}
# export_env PATH
# log_info "ccache installed at ${use_ccache}, caching compilations..."
# log_info "gcc installed at ${use_gcc}..."
# fi
}
# Checks if an array contains a value # Checks if an array contains a value
# taken from here: https://stackoverflow.com/questions/3685970/check-if-an-array-contains-a-value # taken from here: https://stackoverflow.com/questions/3685970/check-if-an-array-contains-a-value
# Parameters: <value-to-check> <array-variable> # Parameters: <value-to-check> <array-variable>
...@@ -205,49 +235,28 @@ if [ -z "${CONDA_FOLDER}" ]; then ...@@ -205,49 +235,28 @@ if [ -z "${CONDA_FOLDER}" ]; then
CONDA_FOLDER=/opt/conda CONDA_FOLDER=/opt/conda
fi fi
if [ -z "${VIRTUALENV_PATH}" ]; then PYVER=py$(echo ${PYTHON_VERSION} | tr -d '.')
VIRTUALENV_PATH=env if [ -z "${CONDA_ENV}" ]; then
if [ -d "${CONDA_FOLDER}/envs/bob-devel-${PYVER}-${CI_BUILD_REF_NAME}" ]; then
CONDA_ENV=bob-devel-${PYVER}-${CI_BUILD_REF_NAME}
else
CONDA_ENV=bob-devel-${PYVER}
fi
fi fi
BOB_PREFIX_PATH=${CONDA_FOLDER}/envs/${CONDA_ENV}
if [ -z "${DOCSERVER}" ]; then if [ -z "${DOCSERVER}" ]; then
DOCSERVER=http://www.idiap.ch DOCSERVER=http://www.idiap.ch
export_env DOCSERVER export_env DOCSERVER
fi fi
PREFIX=${CI_PROJECT_DIR}/${VIRTUALENV_PATH} if [ -z "{PREFIX}" ]; then
PREFIX=${CI_PROJECT_DIR}/build-prefix
if [ "${OSNAME}" == "linux" ]; then # In case we're setting-up the prefix, erase it if it exists
# Temporary hack to get building done right with gcc-5 compilers if [ -d "${PREFIX}" ]; then
if [ -z "${CFLAGS}" ]; then run_cmd rm -rf ${PREFIX}
CFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0"
else
if [[ "${CFLAGS}" != *-D_GLIBCXX_USE_CXX11_ABI=0* ]]; then
CFLAGS="${CFLAGS} -D_GLIBCXX_USE_CXX11_ABI=0"
fi
fi
else #macosx
if [ "${CFLAGS}" == *-DBZ_DEBUG* ]; then
# -DBZ_DEBUG does not work well with clang
CFLAGS=`echo ${CFLAGS} | sed -e s/\s*-DBZ_DEBUG//g`
fi
fi
CXXFLAGS=${CFLAGS}
PYVER=py$(echo ${PYTHON_VERSION} | tr -d '.')
if [ -z "${BOB_PREFIX_PATH}" ]; then
# Default on stock installations for our CIs
BOB_PREFIX_PATH=${CONDA_FOLDER}/envs/bob-devel-${PYVER}
# Unless, a special environment (to be tested) exists matching the branch
if [ -d ${BOB_PREFIX_PATH}-${CI_BUILD_REF_NAME} ]; then
BOB_PREFIX_PATH=${BOB_PREFIX_PATH}-${CI_BUILD_REF_NAME}
fi fi
fi fi
LD_LIBRARY_PATH=${BOB_PREFIX_PATH}/lib
if [ "${OSNAME}" == "macosx" ]; then
DYLD_FALLBACK_LIBRARY_PATH=${BOB_PREFIX_PATH}/lib
MACOSX_DEPLOYMENT_TARGET=10.9
fi
if [ -z "${PYPISERVER}" ]; then if [ -z "${PYPISERVER}" ]; then
PYPISERVER="https://pypi.python.org/pypi" PYPISERVER="https://pypi.python.org/pypi"
...@@ -258,18 +267,12 @@ TESTSERVER=https://testpypi.python.org/pypi ...@@ -258,18 +267,12 @@ TESTSERVER=https://testpypi.python.org/pypi
check_env OSNAME check_env OSNAME
check_env PYVER check_env PYVER
check_env PREFIX check_env PREFIX
export_env CFLAGS export_env PREFIX
export_env CXXFLAGS
check_env DOCSERVER check_env DOCSERVER
check_env PYPISERVER check_env PYPISERVER
check_env TESTSERVER check_env TESTSERVER
check_env CONDA_FOLDER check_env CONDA_FOLDER
check_env VIRTUALENV_PATH check_env CONDA_ENV
export_env LD_LIBRARY_PATH
if [ "${OSNAME}" == "macosx" ]; then
export_env DYLD_FALLBACK_LIBRARY_PATH
export_env MACOSX_DEPLOYMENT_TARGET
fi
export_env BOB_PREFIX_PATH export_env BOB_PREFIX_PATH
if [ -z "${CI_BUILD_TAG}" ]; then if [ -z "${CI_BUILD_TAG}" ]; then
...@@ -284,6 +287,3 @@ if [ -z "${CI_BUILD_TAG}" ]; then ...@@ -284,6 +287,3 @@ if [ -z "${CI_BUILD_TAG}" ]; then
else else
log_info "Building tag, not setting BOB_DOCUMENTATION_SERVER" log_info "Building tag, not setting BOB_DOCUMENTATION_SERVER"
fi fi
# Activates conda environment
run_cmd source ${BOB_PREFIX_PATH}/bin/activate `basename ${BOB_PREFIX_PATH}`
...@@ -3,12 +3,19 @@ ...@@ -3,12 +3,19 @@
# Installation script for our build tools # Installation script for our build tools
if [ "${#}" -ne 1 ]; then if [ "${#}" -eq 0 ]; then
echo "usage: ${0} <ci-support-directory>" echo "usage: ${0} <ci-support-directory> [<branch>]"
echo "example: ${0} _ci" echo "example: ${0} _ci"
echo "example: ${0} _ci staging"
exit 1 exit 1
fi fi
if [ -n "$2" ]; then
BRANCH=$2;
else
BRANCH=master;
fi
# Functions for coloring echo commands # Functions for coloring echo commands
log_info() { log_info() {
...@@ -34,7 +41,7 @@ run_cmd() { ...@@ -34,7 +41,7 @@ run_cmd() {
get_script() { get_script() {
local url="https://gitlab.idiap.ch/bob/bob.admin/raw/master/gitlab/${2}" local url="https://gitlab.idiap.ch/bob/bob.admin/raw/${BRANCH}/gitlab/${2}"
local curlopt="--location --silent --show-error --output ${1}/${2}" local curlopt="--location --silent --show-error --output ${1}/${2}"
if [ -e ${1}/${2} ]; then if [ -e ${1}/${2} ]; then
rm -f ${1}/${2} rm -f ${1}/${2}
......
...@@ -3,11 +3,28 @@ ...@@ -3,11 +3,28 @@
source $(dirname ${0})/functions.sh source $(dirname ${0})/functions.sh
prepare_build_env ${CONDA_FOLDER} ${PREFIX}
run_cmd cd ${PREFIX} run_cmd cd ${PREFIX}
# Checks some programs
use_python=`which python`
check_env use_python
use_coverage=`which coverage`
check_env use_coverage
use_nosetests=`which nosetests`
check_env use_nosetests
use_sphinx=`which sphinx-build`
check_env use_sphinx
# The tests: # The tests:
run_cmd ${PREFIX}/bin/python ${BOB_PREFIX_PATH}/bin/coverage run --source=${CI_PROJECT_NAME} ${BOB_PREFIX_PATH}/bin/nosetests -sv ${CI_PROJECT_NAME}
run_cmd ${PREFIX}/bin/python ${BOB_PREFIX_PATH}/bin/coverage report run_cmd ${use_coverage} run --source=${CI_PROJECT_NAME} ${use_nosetests} -sv ${CI_PROJECT_NAME}
run_cmd ${PREFIX}/bin/python ${BOB_PREFIX_PATH}/bin/sphinx-build -b doctest ${CI_PROJECT_DIR}/doc ${CI_PROJECT_NAME}/sphinx run_cmd ${use_coverage} report
run_cmd ${use_sphinx} -b doctest ${CI_PROJECT_DIR}/doc ${CI_PROJECT_NAME}/sphinx
run_cmd cd ${CI_PROJECT_DIR} run_cmd cd ${CI_PROJECT_DIR}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment