Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added environment variables #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ Clone this repository

Place your website in the `public` folder

## Environment variables

```bash
VM_MEMORY=512
VM_CORES=1
VM_ARCH=32
```

## Usage
Start the VM

Expand Down
23 changes: 21 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

# Environment variables
#################################

MEMORY = ENV['VM_MEMORY'] || '512'
CORES = ENV['VM_CORES'] || '1'
ARCH = ENV['VM_ARCH'] || '32'

# General project settings
#################################

Expand All @@ -26,12 +33,24 @@ Vagrant.configure("2") do |config|
config.omnibus.chef_version = :latest

# Define VM box to use
config.vm.box = "precise32"
config.vm.box_url = "http://files.vagrantup.com/precise32.box"
config.vm.box = "precise#{ARCH}"
config.vm.box_url = "http://files.vagrantup.com/precise#{ARCH}.box"

# Set share folder
config.vm.synced_folder "./" , "/var/www/" + project_name + "/", :mount_options => ["dmode=777", "fmode=666"]

# Provider-specific configuration so you can fine-tune VirtualBox for Vagrant.
# These expose provider-specific options.
config.vm.provider :virtualbox do |vm|
# Use VBoxManage to customize the VM. For example to change memory:
vm.customize ["modifyvm", :id, "--memory", MEMORY.to_i]
vm.customize ["modifyvm", :id, "--cpus", CORES.to_i]

if CORES.to_i > 1
vm.customize ["modifyvm", :id, "--ioapic", "on"]
end
end

# Use hostonly network with a static IP Address and enable
# hostmanager so we can have a custom domain for the server
# by modifying the host machines hosts file
Expand Down