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

[ci] Prevent artifact forget

parent 93edfdca
No related branches found
No related tags found
No related merge requests found
Pipeline #25806 failed
...@@ -36,6 +36,18 @@ run_cmd() { ...@@ -36,6 +36,18 @@ run_cmd() {
fi fi
} }
# Checks just if the variable is defined and has non-zero length
check_defined() {
if [ -z "${!1+abc}" ]; then
log_error "Variable ${1} is undefined - aborting...";
exit 1
elif [ -z "${!1}" ]; then
log_error "Variable ${1} is zero-length - aborting...";
exit 1
fi
log_info "${1}=${!1}"
}
# merges conda cache folders # merges conda cache folders
# $1: Path to the main cache to keep. The directory must exist. # $1: Path to the main cache to keep. The directory must exist.
# $2: Path to the extra cache to be merged into main cache # $2: Path to the extra cache to be merged into main cache
...@@ -45,24 +57,15 @@ merge_conda_cache() { ...@@ -45,24 +57,15 @@ merge_conda_cache() {
_urlstxt="${1}/urls.txt" _urlstxt="${1}/urls.txt"
if [ -e ${2} ]; then if [ -e ${2} ]; then
log_info "Merging urls.txt and packages with cached files..." log_info "Merging urls.txt and packages with cached files..."
mv ${2}/*.tar.bz2 ${1}/ run_cmd mv ${2}/pkgs/*.tar.bz2 ${1}/pkgs
cat ${_urlstxt} ${_cached_urlstxt} | sort | uniq > ${_urlstxt} cat ${_urlstxt} ${_cached_urlstxt} | sort | uniq > ${_urlstxt}
log_info "Moving conda-bld packages (artifacts)..."
run_cmd mv ${2}/conda-bld ${1}
run_cmd conda index ${1}/conda-bld
fi fi
fi fi
} }
# Checks just if the variable is defined and has non-zero length
check_defined() {
if [ -z "${!1+abc}" ]; then
log_error "Variable ${1} is undefined - aborting...";
exit 1
elif [ -z "${!1}" ]; then
log_error "Variable ${1} is zero-length - aborting...";
exit 1
fi
log_info "${1}=${!1}"
}
# installs a miniconda installation. # installs a miniconda installation.
# $1: Path to where to install miniconda. # $1: Path to where to install miniconda.
install_miniconda() { install_miniconda() {
...@@ -93,7 +96,7 @@ install_miniconda() { ...@@ -93,7 +96,7 @@ install_miniconda() {
run_cmd bash miniconda.sh -b -p ${1} run_cmd bash miniconda.sh -b -p ${1}
# Put back cache and merge urls.txt # Put back cache and merge urls.txt
merge_conda_cache ${1}/pkgs ${1}.cached/pkgs merge_conda_cache ${1} ${1}.cached
# remove the backup cache folder # remove the backup cache folder
rm -rf ${1}.cached rm -rf ${1}.cached
...@@ -133,9 +136,7 @@ CONDA_CLI_CHANNELS="-c ${CONDA_CHANNEL_ROOT} -c defaults" ...@@ -133,9 +136,7 @@ CONDA_CLI_CHANNELS="-c ${CONDA_CHANNEL_ROOT} -c defaults"
if [ "${1}" == "build" ]; then if [ "${1}" == "build" ]; then
run_cmd ${CONDA_ROOT}/bin/conda install -n base python conda=4 conda-build=3 run_cmd ${CONDA_ROOT}/bin/conda install -n base python conda=4 conda-build=3
elif [ "${1}" == "local" ]; then elif [ "${1}" == "local" ]; then
run_cmd ${CONDA_ROOT}/bin/conda index ${CONDA_ROOT}/conda-bld
CONDA_CLI_CHANNELS="-c ${CONDA_ROOT}/conda-bld ${CONDA_CLI_CHANNELS}" CONDA_CLI_CHANNELS="-c ${CONDA_ROOT}/conda-bld ${CONDA_CLI_CHANNELS}"
run_cmd ls -l ${CONDA_ROOT}/conda-bld/
run_cmd ${CONDA_ROOT}/bin/conda create -n "${2}" --override-channels ${CONDA_CLI_CHANNELS} bob.devtools run_cmd ${CONDA_ROOT}/bin/conda create -n "${2}" --override-channels ${CONDA_CLI_CHANNELS} bob.devtools
elif [ "${1}" == "beta" ] || [ "${1}" == "stable" ]; then elif [ "${1}" == "beta" ] || [ "${1}" == "stable" ]; then
run_cmd ${CONDA_ROOT}/bin/conda create -n "${2}" --override-channels ${CONDA_CLI_CHANNELS} bob.devtools run_cmd ${CONDA_ROOT}/bin/conda create -n "${2}" --override-channels ${CONDA_CLI_CHANNELS} bob.devtools
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment