Skip to content
New issue

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

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

Already on GitHub? # to your account

adding variable to disable forwarding and to change host name #96

Merged
merged 15 commits into from
Feb 10, 2016
Merged
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
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