gitlab-ci: Create swap space to work around the 2G image
authorAndrew Bartlett <abartlet@samba.org>
Tue, 20 Mar 2018 01:15:47 +0000 (14:15 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 27 Mar 2018 21:03:13 +0000 (23:03 +0200)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
.gitlab-ci.yml

index 60accd463a7bbaa0c9b24782f8bdc4738862cc4e..287011cd5680fe09208d8a4e929ea483336a295f 100644 (file)
@@ -1,7 +1,12 @@
 # see https://docs.gitlab.com/ce/ci/yaml/README.html for all available options
 
 before_script:
-  - echo "Build starting ..."
+  - echo "Build starting (preparing swap)..."
+  - if [ $(df -m / --output=avail | tail -n1) -gt 10240 ]; then
+      sudo dd if=/dev/zero of=/samba-swap bs=1M count=6144;
+      sudo mkswap /samba-swap;
+      sudo swapon /samba-swap;
+    fi
 
 build_samba:
   stage: build