Skip to content

Commit

Permalink
Merge pull request #96 from lo5an/dev-variables
Browse files Browse the repository at this point in the history
adding variable to disable forwarding and to change host name
  • Loading branch information
ruebot committed Feb 10, 2016
2 parents 31df8be + 0c83d81 commit 30eabfe
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,37 @@

The is a development environment virtual machine for Islandora 7.x-1.x. It should work on any operating system that supports VirtualBox and Vagrant.

N.B. This virtual machine **should not** be used in production.


## Requirements

1. [VirtualBox](https://www.virtualbox.org/)
2. [Vagrant](http://www.vagrantup.com/)


## Variables

### System Resources

By default the virtual machine that is built uses 3GB of RAM. Your host machine will need to be able to support that. You can override the CPU and RAM allocation by creating `ISLANDORA_VAGRANT_CPUS` and `ISLANDORA_VAGRANT_MEMORY` environment variables and setting the values. For example, on an Ubuntu host you could add to `~/.bashrc`:

```bash
export ISLANDORA_VAGRANT_CPUS=4
export ISLANDORA_VAGRANT_MEMORY=4096
```

N.B. This virtual machine **should not** be used in production.
### Hostname and Port Forwarding

If you use a DNS or host file management plugin with Vagrant, you may want to set a specific hostname for the virtual machine and disable port forwarding. You can do that with the `ISLANDORA_VAGRANT_HOSTNAME` and `ISLANDORA_VAGRANT_FORWARD` variables. For example:

```bash
export ISLANDORA_VAGRANT_HOSTNAME="islandora.vagrant.test"
export ISLANDORA_VAGRANT_FORWARD="FALSE"
```


## Requirements

1. [VirtualBox](https://www.virtualbox.org/)
2. [Vagrant](http://www.vagrantup.com/)

## Use

Expand Down
14 changes: 10 additions & 4 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ VAGRANTFILE_API_VERSION = "2"

$cpus = ENV.fetch("ISLANDORA_VAGRANT_CPUS", "2")
$memory = ENV.fetch("ISLANDORA_VAGRANT_MEMORY", "3000")
$hostname = ENV.fetch("ISLANDORA_VAGRANT_HOSTNAME", "islandora")
$forward = ENV.fetch("ISLANDORA_VAGRANT_FORWARD", "TRUE")

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
Expand All @@ -14,14 +16,18 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provider "virtualbox" do |v|
v.name = "Islandora 7.x-1.x Development VM"
end
config.vm.hostname = "islandora"

config.vm.hostname = $hostname

# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "islandora/islandora-base"

config.vm.network :forwarded_port, guest: 8080, host: 8080 # Tomcat
config.vm.network :forwarded_port, guest: 3306, host: 3306 # MySQL
config.vm.network :forwarded_port, guest: 8000, host: 8000 # Apache

unless $forward.eql? "FALSE"
config.vm.network :forwarded_port, guest: 8080, host: 8080 # Tomcat
config.vm.network :forwarded_port, guest: 3306, host: 3306 # MySQL
config.vm.network :forwarded_port, guest: 8000, host: 8000 # Apache
end

config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--memory", $memory]
Expand Down

0 comments on commit 30eabfe

Please # to comment.