benchmark-repository-rs/examples/test-job.sh

38 lines
661 B
Bash
Executable File

#!/bin/bash
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --exclusive
#SBATCH --partition=kr
tmp_dir=/home/pluehne/tmp
mkdir -p "$tmp_dir"
dir="$tmp_dir"/"job-$JOB_ID"
if [[ -d $dir ]]
then
rm -rf "$dir"
fi
mkdir -p "$dir"
pushd "$dir"
git clone "$JOB_RESULT_REPOSITORY_URL" repository
pushd repository
git config user.name "Potassco Bot"
git config user.email "bot@potassco.org"
echo "start of benchmark output of job $JOB_KEY" > output
sleep "$TIME"
echo "collected $FRUIT" >> output
echo "end of benchmark output of job $JOB_KEY" >> output
git add output
git commit -m "Add results of job $JOB_KEY"
git push
popd
popd