diff --git a/.github/workflows/test_software_layer_scripts.yml b/.github/workflows/test_software_layer_scripts.yml index 0ce4fa2aac..681b02c686 100644 --- a/.github/workflows/test_software_layer_scripts.yml +++ b/.github/workflows/test_software_layer_scripts.yml @@ -36,7 +36,7 @@ jobs: # Reference checksum # UPDATE THIS CHECKSUM IF AND ONLY IF WE ACTUALLY WANT TO CHANGE bot/build.sh - EXPECTED_CHECKSUM="622e0b4d39543aaf70ee912edd0660c3746d7a1ecb176e0d41df598155e50e21" + EXPECTED_CHECKSUM="d0f6b355a0dc9f00e38166ebdb5025455003aa8e258d31f37790f3adc7cb3f90" # Compute checksum COMPUTED_CHECKSUM=$(sha256sum bot/build.sh | awk '{print $1}') diff --git a/bot/build.sh b/bot/build.sh index ab16402ced..067ee56f23 100755 --- a/bot/build.sh +++ b/bot/build.sh @@ -5,29 +5,33 @@ set -e TOPDIR=$(dirname $(realpath $0)) -# Clone the commit from software-layer-scripts that corresponds to `bot/software_layer_scripts_commit` -commit_sha=$(cat ${TOPDIR}/software_layer_scripts_commit) - -# Get a shallow clone first -git clone --depth 1 --filter=blob:none --no-checkout https://github.com/EESSI/software-layer-scripts - -# Fetch the relevant commit & check it out -cd software-layer-scripts -git fetch --depth=1 origin ${commit_sha} -git checkout --detach ${commit_sha} -cd .. - -# symlink everything, except for: -# - common files like LICENSE and README.md -# - 'bot' subdirectory, there we need to be a bit more careful (see below) -for file in $(ls software-layer-scripts | egrep -v 'easystacks|LICENSE|README.md|^bot'); do - ln -s software-layer-scripts/${file} -done - -# symlink all scripts in 'bot' subdirectory, except for bot/build.sh -for file in $(ls software-layer-scripts/bot | grep -v '^build.sh'); do - ln -s ../software-layer-scripts/bot/${file} bot/${file} -done +# Clone the software-layer-scripts, but only if not running interactively +# (interactive builds are done in job staging dirs prepared by the bot - they already contain a clone) +if [[ -z "${EESSI_INTERACTIVE_BUILD}" ]]; then + # Clone the commit from software-layer-scripts that corresponds to `bot/software_layer_scripts_commit` + commit_sha=$(cat ${TOPDIR}/software_layer_scripts_commit) + + # Get a shallow clone first + git clone --depth 1 --filter=blob:none --no-checkout https://github.com/EESSI/software-layer-scripts + + # Fetch the relevant commit & check it out + cd software-layer-scripts + git fetch --depth=1 origin ${commit_sha} + git checkout --detach ${commit_sha} + cd .. + + # symlink everything, except for: + # - common files like LICENSE and README.md + # - 'bot' subdirectory, there we need to be a bit more careful (see below) + for file in $(ls software-layer-scripts | egrep -v 'easystacks|LICENSE|README.md|^bot'); do + ln -s software-layer-scripts/${file} + done + + # symlink all scripts in 'bot' subdirectory, except for bot/build.sh + for file in $(ls software-layer-scripts/bot | grep -v '^build.sh'); do + ln -s ../software-layer-scripts/bot/${file} bot/${file} + done +fi # call out to bot/build.sh script from software-layer-scripts software-layer-scripts/bot/build.sh