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

38 lines
661 B
Bash
Raw Normal View History

2018-11-08 16:02:38 +01:00
#!/bin/bash
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --exclusive
#SBATCH --partition=kr
tmp_dir=/home/pluehne/tmp
mkdir -p "$tmp_dir"
2019-03-02 00:53:57 +01:00
dir="$tmp_dir"/"job-$JOB_ID"
2018-11-08 16:02:38 +01:00
if [[ -d $dir ]]
then
rm -rf "$dir"
fi
mkdir -p "$dir"
pushd "$dir"
2019-03-02 00:53:57 +01:00
git clone "$JOB_RESULT_REPOSITORY_URL" repository
2018-11-08 16:02:38 +01:00
pushd repository
git config user.name "Potassco Bot"
git config user.email "bot@potassco.org"
2019-03-02 02:34:02 +01:00
echo "start of benchmark output of job $JOB_KEY" > output
2019-03-02 04:24:52 +01:00
2019-03-02 02:32:28 +01:00
sleep "$TIME"
2019-03-02 02:35:57 +01:00
echo "collected $FRUIT" >> output
2019-03-02 04:24:52 +01:00
2019-03-02 02:34:02 +01:00
echo "end of benchmark output of job $JOB_KEY" >> output
2019-03-02 04:24:52 +01:00
2019-03-02 02:34:02 +01:00
git add output
2019-03-02 02:32:28 +01:00
git commit -m "Add results of job $JOB_KEY"
2018-11-08 16:02:38 +01:00
git push
popd
2019-03-02 00:53:57 +01:00
popd