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

Add support for using conda environments derived from branch names (addresses MR!24, issue #31)

parent d116de0b
Branches
No related tags found
No related merge requests found
......@@ -172,6 +172,18 @@ doc_upload() {
log_info "Successfully uploaded ${1} with curl"
}
# Checks 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>
# Usage: "a string" "${array[@]}"
contains_element () {
local e
for e in "${@:2}"; do [[ "$e" == "$1" ]] && return 0; done
return 1
}
check_env PYTHON_VERSION
check_env CI_PROJECT_DIR
check_env CI_PROJECT_PATH
......@@ -220,6 +232,11 @@ 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
LD_LIBRARY_PATH=${BOB_PREFIX_PATH}/lib
......@@ -248,10 +265,3 @@ if [ -z "${CI_BUILD_TAG}" ]; then
else
log_info "Building tag, not setting BOB_DOCUMENTATION_SERVER"
fi
# taken from here: https://stackoverflow.com/questions/3685970/check-if-an-array-contains-a-value
contains_element () {
local e
for e in "${@:2}"; do [[ "$e" == "$1" ]] && return 0; done
return 1
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment