2882: Added crunchstat service to collect cgroup stats, and added support to
[arvados.git] / services / crunch / crunchstat / go.sh
diff --git a/services/crunch/crunchstat/go.sh b/services/crunch/crunchstat/go.sh
new file mode 100755 (executable)
index 0000000..640a0d2
--- /dev/null
@@ -0,0 +1,15 @@
+#! /bin/sh
+
+# Wraps the 'go' executable with some environment setup.  Sets GOPATH, creates
+# 'pkg' and 'bin' directories, automatically installs dependencies, then runs
+# the underlying 'go' executable with any command line parameters provided to
+# the script.
+
+rootdir=$(readlink -f $(dirname $0))
+GOPATH=$rootdir:$rootdir/../../sdk/go:$GOPATH
+export GOPATH
+
+mkdir -p $rootdir/pkg
+mkdir -p $rootdir/bin
+
+go $*