ricardoamaro / drupalci_testbot

This is a testing version of Drupal testbot using docker containers. Please use:
https://drupal.org/project/drupalci_testbot
MIT License
53 stars 21 forks source link

Check for available disk space before testing #7

Closed ricardoamaro closed 10 years ago

ricardoamaro commented 10 years ago
diff --git a/distributed/apachephp/run.sh b/distributed/apachephp/run.sh
index 75deafa..6442013 100755
--- a/distributed/apachephp/run.sh
+++ b/distributed/apachephp/run.sh
@@ -116,6 +116,20 @@ fi

 mkdir -p ${REPODIR}

+# Check if we have free disk space
+FREEDISK=$(df -m ${BUILDSDIR} | tail -n1 | awk '{print $4}')
+if (( $FREEDISK <= 100 )); 
+  then 
+    echo ""
+    echo "ERROR! Low disk space!"; 
+    echo ""
+    df -hT ${BUILDSDIR}
+    echo ""
+    echo "Try to clean up some disk space from ${BUILDSDIR}"
+    echo "A minimum of 100MB is required..."
+    exit 1; 
+fi
+
 # If we are using mysql make sure the conatiner is there
 if [[ $DBTYPE = "mysql" ]]
   then