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 ...@@ -268,12 +268,14 @@ fi
# $1: Path to where to install miniconda. The path should not exist. # $1: Path to where to install miniconda. The path should not exist.
install_miniconda() { install_miniconda() {
log_info "Installing miniconda in ${1} ..." log_info "Installing miniconda in ${1} ..."
# Download the latest conda installation script # Download the latest conda installation script
if [ "${OSNAME}" == "macosx" ]; then if [ "${OSNAME}" == "macosx" ]; then
object=https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh object=https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
else else
object=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh object=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
fi fi
# check if miniconda.sh exists # check if miniconda.sh exists
if [ ! -e miniconda.sh ]; then if [ ! -e miniconda.sh ]; then
log_info "Downloading latest miniconda3 installer..." log_info "Downloading latest miniconda3 installer..."
...@@ -282,21 +284,27 @@ install_miniconda() { ...@@ -282,21 +284,27 @@ install_miniconda() {
log_info "Re-using cached miniconda3 installer..." log_info "Re-using cached miniconda3 installer..."
ls -l miniconda.sh ls -l miniconda.sh
fi fi
# Check if cache exists and save urls.txt to create a valid cache after conda # Check if cache exists and save urls.txt to create a valid cache after conda
# installation override # installation override
_urls="${1}/pkgs/urls.txt" _urls="${1}/pkgs/urls.txt"
if [ -e ${_urls} ]; then if [ -e ${_urls} ]; then
run_cmd cp ${_urls} ${_urls}.cached run_cmd cp ${_urls} ${_urls}.cached
fi fi
# install miniconda
bash miniconda.sh -b -p ${1} bash miniconda.sh -b -p ${1}
# Reset urls.txt # Reset urls.txt
if [ -e ${_urls}.cached ]; then if [ -e ${_urls}.cached ]; then
log_info "Merging urls.txt files with cached values..." log_info "Merging urls.txt files with cached values..."
cat ${_urls} ${_urls}.cached | sort | uniq > ${_urls} cat ${_urls} ${_urls}.cached | sort | uniq > ${_urls}
fi fi
# List currently available packages on cache # List currently available packages on cache
run_cmd ls -l ${1}/pkgs/ run_cmd ls -l ${1}/pkgs/
run_cmd cat ${1}/pkgs/urls.txt run_cmd cat ${1}/pkgs/urls.txt
hash -r hash -r
} }
...@@ -323,7 +331,7 @@ if [ -z "${CONDA_FOLDER}" ]; then ...@@ -323,7 +331,7 @@ if [ -z "${CONDA_FOLDER}" ]; then
fi fi
# check if a conda installation exists. Otherwise, install one: # check if a conda installation exists. Otherwise, install one:
if [ ! -e $1 ]; then if [ ! -e ${CONDA_FOLDER} ]; then
install_miniconda ${CONDA_FOLDER} install_miniconda ${CONDA_FOLDER}
fi fi
......
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