From ad94a6f1bf38b2dfed2f106aef34f810cc118ab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Thu, 8 Nov 2018 16:02:38 +0100 Subject: [PATCH] Add example sbatch job script --- examples/test-job.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 examples/test-job.sh diff --git a/examples/test-job.sh b/examples/test-job.sh new file mode 100755 index 0000000..6ea240b --- /dev/null +++ b/examples/test-job.sh @@ -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