-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
71 lines (62 loc) · 2.66 KB
/
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Install necessary stuff for node.js
config.vm.provision "shell", inline:
<<-SHELL
apt-get update
apt-get install -y g++
curl -sL https://deb.nodesource.com/setup_0.12 | sh
apt-get install -y nodejs
su vagrant
mkdir /home/vagrant/node_modules
cd /home/ubuntu/project
ln -s /home/vagrant/node_modules/ node_modules
npm install karma
npm install forever -g
SHELL
# Run the script that make server to run forever
config.vm.provision :shell, path: "shell_script/run_forever.sh", run: 'always'
config.vm.box = "ubuntu/trusty64"
config.vm.box_version = '>= 20160921.0.0'
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:3000” will access port 3000 on the guest machine.
config.vm.network "forwarded_port", guest: 3000, host: 3000
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
config.vm.synced_folder "./", "/home/ubuntu/project"
# config.vm.synced_folder "../data", "/vagrant_data"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# If you need to more than double the defaults for this course, you have
# done something wrong.
cpus = "1"
memory = "1024" # MB
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--cpus", cpus, "--memory", memory]
vb.customize ["modifyvm", :id, "--uartmode1", "disconnected"] # speed up boot https://bugs.launchpad.net/cloud-images/+bug/1627844
#vb.gui = true
end
config.vm.provider "vmware_fusion" do |v, override|
v.vmx["memsize"] = memory
v.vmx["numvcpus"] = cpus
end
config.vm.provider :cloudstack do |cloudstack, override|
override.vm.box = "Ubuntu-16.04-keys"
cloudstack.scheme = "http"
cloudstack.host = "sfucloud.ca"
cloudstack.path = "/client/api"
cloudstack.port = "8080"
cloudstack.api_key = ENV['CLOUDSTACK_KEY'] || "AAAAAAAAAAAAAAAA"
cloudstack.secret_key = ENV['CLOUDSTACK_SECRET'] || "AAAAAAAAAAAAAAAA"
cloudstack.service_offering_name = "sc.t2.micro"
cloudstack.zone_name = "NML-Zone"
cloudstack.name = "cmpt470-#{File.basename(Dir.getwd)}-#{Random.new.rand(100)}"
cloudstack.ssh_user = "ubuntu"
cloudstack.security_group_names = ['CMPT 470 firewall']
end
end