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

Fixes to last commit (closes #100)

parent 74dbf09d
Branches
Tags
No related merge requests found
......@@ -21,20 +21,22 @@ BLDOPT="${BLDOPT} --python=${PYTHON_VERSION}"
if [ -n "${BOB_TEST_ONLY}" ]; then
tarball=$(${CONDA_ROOT}/bin/conda build ${BLDOPT} --output conda)
log_info="Only testing package ${tarball}..."
log_info "Only testing package ${tarball}..."
set_conda_channels ${VISIBILITY} ${CI_COMMIT_TAG}
if [ ! -r "${tarball}" ]; then
log_info "Package does not exist locally - checking remote channel..."
remote_name=${CONDA_CHANNELS[0]}/${OSNAME}-64/$(basename ${tarball})
if dav_exists ${remote_name}; then
log_info "Package ${tarball} does not exist locally - checking channel ${CONDA_CHANNELS[0]}..."
remote_name="${CONDA_CHANNELS[0]}/${OSNAME}-64/$(basename ${tarball})"
if url_exists ${remote_name}; then
log_info "Conda tarball exists in remote location, downloading..."
run_cmd curl --silent --output ${tarball} ${remote_name}
url_get ${tarball} ${remote_name}
else
log_error "Package $(basename ${tarball}) does not exist at ${remote_name} - aborting..."
exit 1
fi
fi
BLDOPT="${BLDOPT} --test"
run_cmd ${CONDA_ROOT}/bin/conda build ${BLDOPT} ${tarball}
else
log_info="Building and testing package..."
log_info "Building and testing package..."
run_cmd ${CONDA_ROOT}/bin/conda build ${BLDOPT} conda
fi
......@@ -136,6 +136,23 @@ run_cmd() {
}
# Checks if a file exists on the remote location (not protected by password)
# $1: Path to the file to check on the server
url_exists() {
run_cmd curl --output /dev/null --silent --head --fail --location ${DOCSERVER}/${1}
return $?
}
# Gets a file that exists on the remote location (not protected by password)
# $1: Local destination file path (leading directory must exist)
# $2: URL to the file to get on the server (Use url_exists() above to check)
url_get() {
run_cmd curl --silent --output "${1}" "${DOCSERVER}/${2}"
return $?
}
# Checks if a file exists on the remote location
# $1: Path to the file to check on the server
dav_exists() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment