use /dev/shm for postgres runner if available
this lets us run db tests faster and without privileges
@@ -7,9 +7,15 @@ export GOPATH=$PWD/gopath
export PATH=$GOPATH/bin:$PATH
mkdir /tmp/concourse-pg-runner
-if ! mount -t tmpfs none /tmp/concourse-pg-runner; then
+if ! mount -t tmpfs none /tmp/concourse-pg-runner 2>/dev/null; then
+ if grep '/dev/shm.*tmpfs' /proc/mounts >/dev/null; then
+ mkdir /dev/shm/concourse-pg-runner
+ rmdir /tmp/concourse-pg-runner
+ ln -s /dev/shm/concourse-pg-runner /tmp/concourse-pg-runner
+ else
echo 'failed to mount tmpfs for pg. this is OK, db suite will just be slow'
fi
+fi
cd concourse
