Add example sbatch job script

This commit is contained in:
Patrick Lühne 2018-11-08 16:02:38 +01:00
parent 8ef4497483
commit ad94a6f1bf
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF
1 changed files with 36 additions and 0 deletions

36
examples/test-job.sh Executable file
View File

@ -0,0 +1,36 @@
#!/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_BRANCH_NAME"
if [[ -d $dir ]]
then
rm -rf "$dir"
fi
mkdir -p "$dir"
pushd "$dir"
git clone --single-branch --branch="$JOB_BRANCH_NAME" "$GIT_REMOTE_URL" repository
git config user.name "Potassco Bot"
git config user.email "bot@potassco.org"
pushd repository
echo "$JOB_BRANCH_NAME" > test-output
sleep 10
start_time=$(date +%s%N)
git add test-output
git commit -m "Test update"
git push
end_time=$(date +%s%N)
popd
echo $(expr "$end_time" - "$start_time") >> "$tmp_dir"/overhead
popd