Skip to content
Snippets Groups Projects
Commit 754ef0aa authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

Check for conda-folder exists?

parent 26e50d95
No related branches found
No related tags found
1 merge request!63Conda package based CI
......@@ -268,12 +268,14 @@ fi
# $1: Path to where to install miniconda. The path should not exist.
install_miniconda() {
log_info "Installing miniconda in ${1} ..."
# Download the latest conda installation script
if [ "${OSNAME}" == "macosx" ]; then
object=https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
else
object=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
fi
# check if miniconda.sh exists
if [ ! -e miniconda.sh ]; then
log_info "Downloading latest miniconda3 installer..."
......@@ -282,21 +284,27 @@ install_miniconda() {
log_info "Re-using cached miniconda3 installer..."
ls -l miniconda.sh
fi
# Check if cache exists and save urls.txt to create a valid cache after conda
# installation override
_urls="${1}/pkgs/urls.txt"
if [ -e ${_urls} ]; then
run_cmd cp ${_urls} ${_urls}.cached
fi
# install miniconda
bash miniconda.sh -b -p ${1}
# Reset urls.txt
if [ -e ${_urls}.cached ]; then
log_info "Merging urls.txt files with cached values..."
cat ${_urls} ${_urls}.cached | sort | uniq > ${_urls}
fi
# List currently available packages on cache
run_cmd ls -l ${1}/pkgs/
run_cmd cat ${1}/pkgs/urls.txt
hash -r
}
......@@ -323,7 +331,7 @@ if [ -z "${CONDA_FOLDER}" ]; then
fi
# check if a conda installation exists. Otherwise, install one:
if [ ! -e $1 ]; then
if [ ! -e ${CONDA_FOLDER} ]; then
install_miniconda ${CONDA_FOLDER}
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment