summaryrefslogtreecommitdiff
path: root/job.common
diff options
context:
space:
mode:
Diffstat (limited to 'job.common')
-rw-r--r--job.common22
1 files changed, 22 insertions, 0 deletions
diff --git a/job.common b/job.common
new file mode 100644
index 0000000..ebe6ab1
--- /dev/null
+++ b/job.common
@@ -0,0 +1,22 @@
+# vim: ft=sh
+set -e
+if [ -z "$WORKSPACE" ]; then
+ . "$(dirname "$(readlink -f "$0")")/../fakelaminar"
+fi
+
+# Subprocess inclusion guard
+[ -z "$LAMINAR_COMMON" ]
+export LAMINAR_COMMON=y
+
+# Job and template id
+export JOBID="$(basename "$0" | sed 's/\.run$//')"
+export TEMPLATEID="$(basename "$(readlink -f "$0")" | sed 's/\.run$//')"
+
+# Template workspace
+export TWORKSPACE="$HOME/workspace/$TEMPLATEID"
+if [ "$JOBID" = "$TEMPLATEID" ]; then
+ TWORKSPACE="$HOME/workspace/notemplate"
+fi
+
+# Include utils
+. utils