Merge pull request #121 from derekstraka/update-env-scripts

setup-env: only allow slaves with large amounts of RAM to mount tmpfs
This commit is contained in:
Doug Goldstein
2016-11-30 20:56:16 -06:00
committed by GitHub
2 changed files with 10 additions and 2 deletions
+4 -1
View File
@@ -1,5 +1,8 @@
#!/bin/bash -e
sudo umount build
# Only attempt to unmount if the directory is already mounted
if mountpoint -q `pwd`/build; then
sudo umount build
fi
exit 0
+6 -1
View File
@@ -2,6 +2,11 @@
mkdir -p build
sudo mount -t tmpfs -o size=64G,mode=755,uid=${UID} tmpfs build
total_mem=`grep MemTotal /proc/meminfo | awk '{print $2}'`
# Only have the slaves with large amounts of RAM mount the tmpfs
if [ "$total_mem" -ge "67108864" ]; then
sudo mount -t tmpfs -o size=64G,mode=755,uid=${UID} tmpfs build
fi
exit 0