-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVagrantfile
26 lines (20 loc) · 888 Bytes
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Vagrant.configure(2) do |config|
if Vagrant.has_plugin?("vagrant-cachier")
config.cache.scope = :box
end
## Vagrant vm configuration
config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port", guest:27017, host:27017
config.vm.hostname = 'todos-app'
## Share folders between your host and vm
# config.vm.synced_folder "./HOST_FOLDER", "/VM_FOLDER", create: true
## Inline script execution
config.vm.provision "shell", run: "always", inline: <<-SHELL
wget -qO- https://gist.github.com/MartinsThiago/8a6782ad27d7232c23c3/raw/mongodb_precise.sh | sh
dummy=`wget -qO- http://beta.json-generator.com/api/json/get/LHF0nzJ`
echo "for (var i in $dummy) {db.todo.save($dummy[i])}" > todoInsert.json
mongo todo-app todoInsert.json
SHELL
# External script execution
# config.vm.provision "shell", run: "always", path: "./<script.sh>"
end