4 # This file is for use by Vagrant (http://www.vagrantup.com/).
5 # It will establish a debian-based (Ubuntu) virtual machine for development.
7 # The virtual machine environment attempts to match the production environment
8 # as closely as possible.
10 # This file was generated by `vagrant up` and consequently modified.
12 # Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
13 VAGRANTFILE_API_VERSION = "2"
15 # Install fabric so that the KarmaWorld fabfile may be run.
17 # build a shell script that installs prereqs, configures the database, sets up
18 # the user/group associations, pulls in the code from the host machine, sets up
19 # some external dependency configs, and then runs fabric.
20 shellscript = <<SCRIPT
23 apt-get install -y python-pip postgresql python-virtualenv virtualenvwrapper \
24 git nginx postgresql-server-dev-9.1 libxslt1-dev \
25 libxml2-dev libmemcached-dev python-dev rabbitmq-server
27 echo "CREATE USER vagrant WITH CREATEROLE LOGIN; CREATE DATABASE karmaworld OWNER vagrant;" | su postgres -c "psql"
29 mkdir -m 775 -p /var/www
30 chown -R :www-data /var/www
31 usermod -a -G www-data vagrant
33 su vagrant -c "git clone /vagrant karmaworld"
35 SECRETPATH="karmaworld/karmaworld/secret"
36 CFILE="$SECRETPATH/db_settings.py"
40 # Copyright (C) 2012 FinalsClub Foundation
42 DO NOT check this file into source control.
44 PROD_DB_NAME = 'karmaworld'
45 PROD_DB_USERNAME = 'vagrant'
48 cp $SECRETPATH/filepicker.py.example $SECRETPATH/filepicker.py
49 cp $SECRETPATH/static_s3.py.example $SECRETPATH/static_s3.py
50 chown vagrant:vagrant $SECRETPATH/*.py
53 #su vagrant -c "cd karmaworld; fab here first_deploy"
57 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
58 # All Vagrant configuration is done here. The most common configuration
59 # options are documented and commented below. For a complete reference,
60 # please see the online documentation at vagrantup.com.
62 # Every Vagrant virtual environment requires a box to build off of.
63 config.vm.box = "Official Ubuntu 12.04 daily Cloud Image i386"
64 #config.vm.box = "Official Ubuntu 12.04 daily Cloud Image amd64"
65 #config.vm.box = "Official Ubuntu 12.10 daily Cloud Image i386"
66 #config.vm.box = "Official Ubuntu 12.10 daily Cloud Image amd64"
67 #config.vm.box = "Official Ubuntu 13.04 daily Cloud Image i386"
68 #config.vm.box = "Official Ubuntu 13.04 daily Cloud Image amd64"
69 #config.vm.box = "Official Ubuntu 13.10 daily Cloud Image i386"
70 #config.vm.box = "Official Ubuntu 13.10 daily Cloud Image amd64"
72 # The url from where the 'config.vm.box' box will be fetched if it
73 # doesn't already exist on the user's system.
74 config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-i386-vagrant-disk1.box"
75 #config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box"
76 #config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/quantal/current/quantal-server-cloudimg-i386-vagrant-disk1.box"
77 #config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/quantal/current/quantal-server-cloudimg-amd64-vagrant-disk1.box"
78 #config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/raring/current/raring-server-cloudimg-i386-vagrant-disk1.box"
79 #config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/raring/current/raring-server-cloudimg-amd64-vagrant-disk1.box"
80 #config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/saucy/current/saucy-server-cloudimg-i386-vagrant-disk1.box"
81 #config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/saucy/current/saucy-server-cloudimg-amd64-vagrant-disk1.box"
83 # Create a forwarded port mapping which allows access to a specific port
84 # within the machine from a port on the host machine. In the example below,
85 # accessing "localhost:8080" will access port 80 on the guest machine.
86 # config.vm.network :forwarded_port, guest: 80, host: 8080
88 # OM (sanskrit) KW (KarmaWorld) on a phone: 66 59
89 config.vm.network :forwarded_port, guest: 80, host: 6659, auto_correct: true
91 # Create a private network, which allows host-only access to the machine
92 # using a specific IP.
93 #config.vm.network :private_network, ip: "192.168.66.59"
95 # Create a public network, which generally matched to bridged network.
96 # Bridged networks make the machine appear as another physical device on
98 # Used to directly access the internet for downloading updates and so forth.
99 config.vm.network :public_network
101 # If true, then any SSH connections made will enable agent forwarding.
102 # Default value: false
103 # config.ssh.forward_agent = true
105 # Share an additional folder to the guest VM. The first argument is
106 # the path on the host to the actual folder. The second argument is
107 # the path on the guest to mount the folder. And the optional third
108 # argument is a set of non-required options.
109 # config.vm.synced_folder "../data", "/vagrant_data"
112 config.vm.provision "shell", inline: shellscript
114 # Provider-specific configuration so you can fine-tune various
115 # backing providers for Vagrant. These expose provider-specific options.
116 # Example for VirtualBox:
118 # config.vm.provider :virtualbox do |vb|
119 # # Don't boot with headless mode
122 # # Use VBoxManage to customize the VM. For example to change memory:
123 # vb.customize ["modifyvm", :id, "--memory", "1024"]
126 # View the documentation for the provider you're using for more
127 # information on available options.
129 # Enable provisioning with Puppet stand alone. Puppet manifests
130 # are contained in a directory path relative to this Vagrantfile.
131 # You will need to create the manifests directory and a manifest in
132 # the file base.pp in the manifests_path directory.
134 # An example Puppet manifest to provision the message of the day:
136 # # group { "puppet":
137 # # ensure => "present",
140 # # File { owner => 0, group => 0, mode => 0644 }
142 # # file { '/etc/motd':
143 # # content => "Welcome to your Vagrant-built virtual machine!
144 # # Managed by Puppet.\n"
147 # config.vm.provision :puppet do |puppet|
148 # puppet.manifests_path = "manifests"
149 # puppet.manifest_file = "site.pp"
152 # Enable provisioning with chef solo, specifying a cookbooks path, roles
153 # path, and data_bags path (all relative to this Vagrantfile), and adding
154 # some recipes and/or roles.
156 # config.vm.provision :chef_solo do |chef|
157 # chef.cookbooks_path = "../my-recipes/cookbooks"
158 # chef.roles_path = "../my-recipes/roles"
159 # chef.data_bags_path = "../my-recipes/data_bags"
160 # chef.add_recipe "mysql"
161 # chef.add_role "web"
163 # # You may also specify custom JSON attributes:
164 # chef.json = { :mysql_password => "foo" }
167 # Enable provisioning with chef server, specifying the chef server URL,
168 # and the path to the validation key (relative to this Vagrantfile).
170 # The Opscode Platform uses HTTPS. Substitute your organization for
171 # ORGNAME in the URL and validation key.
173 # If you have your own Chef Server, use the appropriate URL, which may be
174 # HTTP instead of HTTPS depending on your configuration. Also change the
175 # validation key to validation.pem.
177 # config.vm.provision :chef_client do |chef|
178 # chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
179 # chef.validation_key_path = "ORGNAME-validator.pem"
182 # If you're using the Opscode platform, your validator client is
183 # ORGNAME-validator, replacing ORGNAME with your organization name.
185 # If you have your own Chef Server, the default validation client name is
186 # chef-validator, unless you changed the configuration.
188 # chef.validation_client_name = "ORGNAME-validator"