Add build.sh wrapper for build.rb, to make sure Ruby is installed. (Refs #2221)
authorTim Pierce <twp@curoverse.com>
Mon, 10 Mar 2014 15:08:19 +0000 (11:08 -0400)
committerTim Pierce <twp@curoverse.com>
Mon, 10 Mar 2014 15:08:19 +0000 (11:08 -0400)
docker/build.rb [moved from docker/install.rb with 100% similarity]
docker/build.sh

similarity index 100%
rename from docker/install.rb
rename to docker/build.rb
index 6478f814a90cff90b738e38518015b300983a5b5..9473e015b8e3845033a6adb24c5693cc16cd9317 100644 (file)
@@ -1,42 +1,11 @@
 #! /bin/bash
 
-build_ok=true
-
-# Check that:
-#   * IP forwarding is enabled in the kernel.
-
-if [ "$(/sbin/sysctl --values net.ipv4.ip_forward)" != "1" ]
-then
-    echo >&2 "WARNING: IP forwarding must be enabled in the kernel."
-    echo >&2 "Try: sudo sysctl net.ipv4.ip_forward=1"
-    build_ok=false
-fi
-
-#   * Docker can be found in the user's path
-#   * The user is in the docker group
-#   * cgroup is mounted
-#   * the docker daemon is running
-
-if ! docker images > /dev/null 2>&1
+# make sure Ruby is installed before proceeding
+if ! ruby -v > /dev/null 2>&1
 then
-    echo >&2 "WARNING: docker could not be run."
-    echo >&2 "Please make sure that:"
-    echo >&2 "  * You have permission to read and write /var/run/docker.sock"
-    echo >&2 "  * a 'cgroup' volume is mounted on your machine"
-    echo >&2 "  * the docker daemon is running"
-    build_ok=false
+    echo "Installing Ruby. You may be required to enter your password."
+    sudo apt-get update
+    sudo apt-get install ruby
 fi
 
-#   * config.yml exists
-if [ '!' -f config.yml ]
-then
-    echo >&2 "WARNING: no config.yml found in the current directory"
-    echo >&2 "Copy config.yml.example to config.yml and update it with settings for your site."
-    build_ok=false
-fi
-
-# If ok to build, then go ahead and run make
-if $build_ok
-then
-    make $*
-fi
+./build.rb $*