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

merge cache with new installation

parent f4317f05
No related branches found
No related tags found
1 merge request!63Conda package based CI
......@@ -265,7 +265,7 @@ fi
# installs a miniconda installation.
# $1: Path to where to install miniconda. The path should not exist.
# $1: Path to where to install miniconda.
install_miniconda() {
log_info "Installing miniconda in ${1} ..."
......@@ -285,20 +285,29 @@ install_miniconda() {
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
# move cache to a different folder if it exists
if [ -e ${1} ]; then
run_cmd mv ${1} ${1}.cached
fi
# # Save urls.txt to create a valid cache after conda
# # installation override
# 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
# Put back cache and merge urls.txt
if [ -e ${1}.cached ]; then
run_cmd mv -n ${1}.cached/pkgs/*.tar.bz2 ${1}/pkgs/
fi
_cached_urls="${1}.cached/pkgs/urls.txt"
_urls="${1}/pkgs/urls.txt"
if [ -e ${_cached_urls} ]; then
log_info "Merging urls.txt files with cached values..."
cat ${_urls} ${_urls}.cached | sort | uniq > ${_urls}
cat ${_urls} ${_cached_urls} | sort | uniq > ${_urls}
fi
# List currently available packages on cache
......
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