Last active
May 4, 2016 06:21
-
-
Save AaronGhent/63c27ab2a83b0566bc77 to your computer and use it in GitHub Desktop.
Ember CLI Virtual Machine (Ubuntu, Can Run On Windows 7+)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
VAGRANTFILE_API_VERSION = "2" | |
ENV["LC_ALL"] = "en_US.UTF-8" | |
ENV["LC_CTYPE"] = "en_US.UTF-8" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.hostname = "ui-sandbox" | |
config.vm.network :forwarded_port, guest: 4200, host: 4200 | |
config.vm.network :forwarded_port, guest: 49152, host: 49152 | |
config.vm.network :forwarded_port, guest: 35729, host: 35729 | |
config.vm.synced_folder :"./", "/home/vagrant/ui", create: true, owner: "vagrant", group: "vagrant" | |
config.ssh.insert_key = true | |
config.vm.provider "virtualbox" do |v| | |
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] | |
v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/vagrant", "1"] | |
v.customize ['modifyvm', :id, '--memory', 2048] | |
v.customize ["modifyvm", :id, "--cpus", 2] | |
end | |
config.vm.provision "shell", inline: <<-PROVISION | |
echo ":: >><<>><<>><<>><<>><<>><<>><<>><<>><<>><< ::" | |
echo "Installing System (Patience Please)" | |
echo ":: >><<>><<>><<>><<>><<>><<>><<>><<>><<>><< ::" | |
apt-get update | |
apt-get -y install build-essential automake autoconf language-pack-en-base libssl-dev python-dev python-pip htop curl git graphviz | |
PROVISION | |
config.vm.provision "shell", privileged: false, inline: <<-PROVISION | |
wget -qO- https://raw.github.com/creationix/nvm/master/install.sh | sh | |
source ~/.nvm/nvm.sh | |
export NVM_DIR="/home/vagrant/.nvm" | |
nvm install stable | |
nvm alias default stable | |
npm install -g bower | |
npm install -g phantomjs-prebuilt | |
npm install -g jshint | |
npm install -g marked | |
npm install -g ember-cli | |
mkdir /home/vagrant/.fix/ | |
mkdir /home/vagrant/ui/node_modules | |
mkdir /home/vagrant/.fix/node_modules | |
chown vagrant:vagrant /home/vagrant/.fix/node_modules | |
chmod 777 /home/vagrant/.fix/node_modules | |
sudo mount -o bind /home/vagrant/.fix/node_modules /home/vagrant/ui/node_modules | |
mkdir /home/vagrant/ui/tmp | |
mkdir /home/vagrant/.fix/tmp | |
chown vagrant:vagrant /home/vagrant/.fix/tmp | |
chmod 777 /home/vagrant/.fix/tmp | |
sudo mount -o bind /home/vagrant/.fix/tmp /home/vagrant/ui/tmp | |
echo ":: >><<>><<>><<>><<>><<>><<>><<>><<>><<>><< ::" | |
echo "Installing Project Depedancies (Patience Please)" | |
echo ":: >><<>><<>><<>><<>><<>><<>><<>><<>><<>><< ::" | |
cd /home/vagrant/ui/ | |
npm install | |
bower install | |
echo "sudo mount -o bind /home/vagrant/.fix/tmp /home/vagrant/ui/tmp > /dev/null 2>&1" >> /home/vagrant/.bashrc | |
echo "sudo mount -o bind /home/vagrant/.fix/node_modules /home/vagrant/ui/node_modules > /dev/null 2>&1" >> /home/vagrant/.bashrc | |
echo "cd /home/vagrant/ui/" >> /home/vagrant/.bashrc | |
echo "ember s" >> /home/vagrant/.bashrc | |
PROVISION | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment