setup-env: only allow slaves with large amounts of RAM to mount tmpfs
Signed-off-by: Derek Straka <derek@asterius.io>
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
#!/bin/bash -e
|
#!/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
|
exit 0
|
||||||
|
|||||||
@@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
mkdir -p build
|
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
|
exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user