Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test_software_layer_scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}')
Expand Down
50 changes: 27 additions & 23 deletions bot/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading