You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by be...@apache.org on 2013/05/29 14:58:32 UTC

git commit: updated refs/heads/master to f15f54d

Updated Branches:
  refs/heads/master 86dd4eadf -> f15f54d56


Add Vagrantfile

This patch allows us to develop and test couchdb using vagrant
(http://www.vagrantup.com) .

Since we don't have any good debian packaging for now this image is only
useful for developers or those who want to use latest couchdb version.

To use it run the following commad:

    $ vagrant up
    $ vagrant ssh
    $ cd /vagrant

then you can play with the code and build your own distribution of
couch. This image is supporting lxc, ec2 and rackspace providers for
vagrant.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/f15f54d5
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/f15f54d5
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/f15f54d5

Branch: refs/heads/master
Commit: f15f54d56149d3119ca2c06bcd63991071fbbe40
Parents: 86dd4ea
Author: benoitc <bc...@gmail.com>
Authored: Wed May 29 14:53:55 2013 +0200
Committer: benoitc <bc...@gmail.com>
Committed: Wed May 29 14:53:55 2013 +0200

----------------------------------------------------------------------
 Vagrantfile |   70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 70 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/f15f54d5/Vagrantfile
----------------------------------------------------------------------
diff --git a/Vagrantfile b/Vagrantfile
new file mode 100644
index 0000000..465d5a6
--- /dev/null
+++ b/Vagrantfile
@@ -0,0 +1,70 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+BOX_NAME = ENV['BOX_NAME'] || "ubuntu"
+BOX_URI = ENV['BOX_URI'] || "http://files.vagrantup.com/precise64.box"
+AWS_REGION = ENV['AWS_REGION'] || "us-east-1"
+AWS_AMI    = ENV['AWS_AMI']    || "ami-d0f89fb9"
+
+Vagrant::Config.run do |config|
+  # Setup virtual machine box. This VM configuration code is always executed.
+  config.vm.box = BOX_NAME
+  config.vm.box_url = BOX_URI
+
+  # Install couchdb dependencies if deployment was not done
+  if Dir.glob("#{File.dirname(__FILE__)}/.vagrant/machines/default/*/id").empty?
+    # install build-essential
+    pkg_cmd = "apt-get update -qq; apt-get install -q -y build-essential git " 
+        "autoconf autoconf-archive gnu-standards help2man textinfo; "
+
+    # Install erlang
+    pkg_cmd << "apt-get install -q -y erlang-base-hipe erlang-dev " \
+        "erlang-manpages erlang-eunit erlang-nox erlang-xmerl erlang-inets; "
+
+    # couchdb developper dependencies
+    pkg_cmd << "apt-get install -q -y libmozjs185-dev libicu-dev " \
+        "curl libcurl4-gnutls-dev libtool; "
+
+    # doc dependencies
+    pkg_cmd << "apt-get install -q -y apt-get install -q -y help2man " \
+        "textinfo python-sphix python-pip; " \
+        "pip install -U pygments; "
+
+    config.vm.provision :shell, :inline => pkg_cmd
+  end
+end
+
+
+# Providers were added on Vagrant >= 1.1.0
+Vagrant::VERSION >= "1.1.0" and Vagrant.configure("2") do |config|
+  config.vm.provider :aws do |aws, override|
+    aws.access_key_id = ENV["AWS_ACCESS_KEY_ID"]
+    aws.secret_access_key = ENV["AWS_SECRET_ACCESS_KEY"]
+    aws.keypair_name = ENV["AWS_KEYPAIR_NAME"]
+    override.ssh.private_key_path = ENV["AWS_SSH_PRIVKEY"]
+    override.ssh.username = "ubuntu"
+    aws.region = AWS_REGION
+    aws.ami    = AWS_AMI
+    aws.instance_type = "t1.micro"
+  end
+
+  config.vm.provider :rackspace do |rs|
+    config.ssh.private_key_path = ENV["RS_PRIVATE_KEY"]
+    rs.username = ENV["RS_USERNAME"]
+    rs.api_key  = ENV["RS_API_KEY"]
+    rs.public_key_path = ENV["RS_PUBLIC_KEY"]
+    rs.flavor   = /512MB/
+    rs.image    = /Ubuntu/
+  end
+
+  config.vm.provider :virtualbox do |vb|
+    config.vm.box = BOX_NAME
+    config.vm.box_url = BOX_URI
+  end
+
+  config.vm.provider :lxc do |lxc|
+    config.vm.box = BOX_NAME
+    config.vm.box_url = BOX_URI
+    lxc.customize 'cgroup.memory.limit_in_bytes', '1024M'
+  end
+end