[commit: ghc] master: Add a simplistic Vagrantfile with bootstrapping (ace7477)

git at git.haskell.org git at git.haskell.org
Sun Mar 23 00:40:12 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/ace7477690752d85defd71c083863f14db241350/ghc

>---------------------------------------------------------------

commit ace7477690752d85defd71c083863f14db241350
Author: Austin Seipp <austin at well-typed.com>
Date:   Sat Mar 22 15:21:40 2014 -0500

    Add a simplistic Vagrantfile with bootstrapping
    
    This adds a simple Vagrantfile to the root directory, which you can use
    to easily spin up RHEL/Debian/Ubuntu virtual machine in seconds to test
    GHC.
    
    For example, from the root of the GHC tree, you can say:
    
        $ vagrant up ubuntu1204-amd64
        $ vagrant ssh ubuntu1204-amd64
    
    This will give you access to a provisioned Ubuntu 12.04 virtual machine
    with all the necessary GHC dependencies installed (modulo a few things).
    
    Debian 7/CentOS 6.5/Ubuntu 12.04 only for now, in amd64/i386
    configurations. In the future I plan to at least add FreeBSD and NixOS
    boxes where possible.
    
    Improvements are necessary of course. By default a box is given 4GB of
    RAM and 2 cores, and resolves DNS entries by routing through the host
    DNS configuration. Do not run 'vagrant up' unless you have lots of RAM
    as it will spawn *every* virtual machine.
    
    Hopefully, this should make it far easier for contributors to get
    started eventually.
    
    Signed-off-by: Austin Seipp <austin at well-typed.com>


>---------------------------------------------------------------

ace7477690752d85defd71c083863f14db241350
 Vagrantfile               |   50 +++++++++++++++++++++++++++++++++++++++++++++
 vagrant/bootstrap-deb.sh  |    3 +++
 vagrant/bootstrap-rhel.sh |    4 ++++
 3 files changed, 57 insertions(+)

diff --git a/Vagrantfile b/Vagrantfile
new file mode 100644
index 0000000..9c11601
--- /dev/null
+++ b/Vagrantfile
@@ -0,0 +1,50 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+MACHINES =
+  { "ubuntu1204-i386" =>
+      { :box       => "chef/ubuntu-12.04-i386",
+        :provision => "vagrant/bootstrap-deb.sh"
+      },
+    "ubuntu1204-amd64" =>
+      { :box       => "chef/ubuntu-12.04",
+        :provision => "vagrant/bootstrap-deb.sh"
+      },
+    "centos65-i386" =>
+      { :box       => "chef/centos-6.5-i386",
+        :provision => "vagrant/bootstrap-rhel.sh"
+      },
+    "centos65-amd64" =>
+      { :box       => "chef/centos-6.5",
+        :provision => "vagrant/bootstrap-rhel.sh"
+      },
+    "debian74-i386" =>
+      { :box       => "chef/debian-7.4-i386",
+        :provision => "vagrant/bootstrap-deb.sh"
+      },
+    "debian74-amd64" =>
+      { :box       => "chef/debian-7.4",
+        :provision => "vagrant/bootstrap-deb.sh"
+      }
+  }
+
+VAGRANTFILE_API_VERSION = "2"
+Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
+  MACHINES.each_pair do |name, opts|
+    config.vm.define name do |c|
+      c.vm.box = opts[:box]
+      c.vm.network "public_network"
+      c.vm.provision :shell, :path => opts[:provision]
+      c.vm.provider "virtualbox" do |vb|
+        vb.gui = false; vb.memory = 4096; vb.cpus = 2
+        vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
+      end
+      c.vm.provider "vmware_workstation" do |vb|
+        vb.gui = false; vb.vmx["memsize"]  = "4096"; vb.vmx["numvcpus"] = "2"
+      end
+      c.vm.provider "vmware_fusion" do |vb|
+        vb.gui = false; vb.vmx["memsize"]  = "4096"; vb.vmx["numvcpus"] = "2"
+      end
+    end
+  end
+end
diff --git a/vagrant/bootstrap-deb.sh b/vagrant/bootstrap-deb.sh
new file mode 100755
index 0000000..b9ba957
--- /dev/null
+++ b/vagrant/bootstrap-deb.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+apt-get update
+apt-get build-dep -y ghc
diff --git a/vagrant/bootstrap-rhel.sh b/vagrant/bootstrap-rhel.sh
new file mode 100755
index 0000000..5086279
--- /dev/null
+++ b/vagrant/bootstrap-rhel.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+yum update -y
+yum install -y glibc-devel ncurses-devel gmp-devel autoconf automake libtool \
+ gcc make perl python ghc git docbook-utils docbook-utils-pdf docbook-style-xsl



More information about the ghc-commits mailing list