diff --git a/EESSI-pilot-install-software.sh b/EESSI-pilot-install-software.sh index ed5319a6db..c6c51e7abc 100755 --- a/EESSI-pilot-install-software.sh +++ b/EESSI-pilot-install-software.sh @@ -41,7 +41,7 @@ function copy_build_log() { echo "- working directory: ${PWD}" >> ${build_log_path} echo "- Slurm job ID: ${SLURM_OUT}" >> ${build_log_path} echo "- EasyBuild version: ${eb_version}" >> ${build_log_path} - echo "- easystack file: ${es}" >> ${build_log_path} + echo "- easystack file: ${easystack_file}" >> ${build_log_path} echo "EasyBuild log file ${build_log} copied to ${build_log_path} (with context appended)" fi @@ -186,36 +186,42 @@ else echo_green ">> MODULEPATH set up: ${MODULEPATH}" fi -for eb_version in '4.7.2' '4.8.0' '4.8.1'; do +# assume there's only one diff file that corresponds to the PR patch file +pr_diff=$(ls [0-9]*.diff | head -1) + +# use PR patch file to determine in which easystack files stuff was added +for easystack_file in $(cat ${pr_diff} | grep '^+++' | cut -f2 -d' ' | sed 's@^[a-z]/@@g' | grep '^eessi.*yml$'); do + + echo -e "Processing easystack file ${easystack_file}...\n\n" + + # determine version of EasyBuild module to load based on EasyBuild version included in name of easystack file + eb_version=$(echo ${easystack_file} | sed 's/.*eb-\([0-9.]*\).*/\1/g') # load EasyBuild module (will be installed if it's not available yet) source ${TOPDIR}/load_easybuild_module.sh ${eb_version} echo_green "All set, let's start installing some software with EasyBuild v${eb_version} in ${EASYBUILD_INSTALLPATH}..." - for es in $(ls eessi-${EESSI_PILOT_VERSION}-eb-${eb_version}-*.yml); do - - if [ -f ${es} ]; then - echo_green "Feeding easystack file ${es} to EasyBuild..." + if [ -f ${easystack_file} ]; then + echo_green "Feeding easystack file ${easystack_file} to EasyBuild..." - ${EB} --easystack ${TOPDIR}/${es} --robot - ec=$? + ${EB} --easystack ${TOPDIR}/${easystack_file} --robot + ec=$? - # copy EasyBuild log file if EasyBuild exited with an error - if [ ${ec} -ne 0 ]; then - eb_last_log=$(unset EB_VERBOSE; eb --last-log) - # copy to current working directory - cp -a ${eb_last_log} . - echo "Last EasyBuild log file copied from ${eb_last_log} to ${PWD}" - # copy to build logs dir (with context added) - copy_build_log "${eb_last_log}" "${build_logs_dir}" - fi - - $TOPDIR/check_missing_installations.sh ${TOPDIR}/${es} - else - fatal_error "Easystack file ${es} not found!" + # copy EasyBuild log file if EasyBuild exited with an error + if [ ${ec} -ne 0 ]; then + eb_last_log=$(unset EB_VERBOSE; eb --last-log) + # copy to current working directory + cp -a ${eb_last_log} . + echo "Last EasyBuild log file copied from ${eb_last_log} to ${PWD}" + # copy to build logs dir (with context added) + copy_build_log "${eb_last_log}" "${build_logs_dir}" fi - done + + $TOPDIR/check_missing_installations.sh ${TOPDIR}/${easystack_file} + else + fatal_error "Easystack file ${easystack_file} not found!" + fi done