Skip to content
Snippets Groups Projects
Commit 613b1914 authored by Eleni Mathioulaki's avatar Eleni Mathioulaki
Browse files

fix(CI): check for existing mirror before adding or deleting local cache

parent d4aeb24d
No related branches found
No related tags found
1 merge request!651create new experimental release
Pipeline #58982 passed with stage
in 1 hour, 5 minutes, and 37 seconds
......@@ -81,9 +81,12 @@ spack spec aida
# rebuild spack's database (could be an debugging session)
spack reindex
# TODO for newer spack versions, add: --autopush --unsigned, drop create cache command below
# (Note: spack expects `build_cache/` below the folder we specify here
spack mirror add local_cache ${SPACK_CACHE_BUILD}
# add local mirror if it does not exist
if [[ ! $(spack mirror list | grep local_cache) ]]; then
# TODO for newer spack versions, add: --autopush --unsigned, drop create cache command below
# (Note: spack expects `build_cache/` below the folder we specify here
spack mirror add local_cache ${SPACK_CACHE_BUILD}
fi
# install platform compiler (extract version from packages.yaml)
if [ $SYSTEMNAME == ebrainslab ]
......@@ -224,7 +227,9 @@ if [ $spack_install_ret -ne 0 ]; then
fi
# remove local cache content
spack mirror destroy --mirror-name local_cache
if [ -d ${SPACK_CACHE_BUILD} ]; then
spack mirror destroy --mirror-name local_cache
fi
# TODO: when using spack remote OCI build caches require an index file
#spack mirror add ebrains oci://docker-registry.ebrains.eu/esd/build_cache
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment