$cd /path/to/project/vagrant
$vagrant up
$startx
(Starts a Gnome UI)$which npm
(/opt/node-v6.4.0-linux-x64/bin)$sudo visudo
(Requires basic knowledge of Vi/Vim)$npm install npm -g
$npm install aurelia-cli -g
$cd /path/to/project/vagrant
(If you're not already in the directory with the Vagrantfile)$vagrant halt
(Keeps all files, closes GUI, shuts down VM)$vagrant up
(Restart VM, login via GUI when it's ready)$vagrant destroy
(Will need to download everything again, your local files will be deleted. Use this to start from scratch.)Now you're ready to start building your website using Aurelia CLI!
Vagrantfile
Vagrant.configure("2") do |config| config.vm.box = "centos/7" config.vm.hostname = "dev" config.vm.provider "virtualbox" do |vb| vb.gui = true vb.cpus = "4" vb.memory = "3092" end # Networking config.vm.network "private_network", ip: "192.168.0.3" config.vm.network :forwarded_port, guest: 80, host: 80 # nginx config.vm.network :forwarded_port, guest: 9000, host: 9000 # au run config.vm.network :forwarded_port, guest: 3001, host:3001 # BrowserSynch # Shares config.vm.synced_folder "../provision", "/home/vagrant/provision" # Provision config.vm.provision "shell", path: "provision.sh" end
provision.sh
HOME=/home/vagrant NODE=node-v6.4.0-linux-x64 EPEL=epel-release-latest-7.noarch.rpm ATOM=atom.x86_64 echo "************************************" echo "Provisioning virtual machine..." echo "************************************" sudo cd $HOME echo "***********************" echo "Updating yum..." echo "***********************" sudo yum clean all sudo yum -y install deltarpm yum-utils sudo yum -y update --exclude=kernel* echo "***********************" echo "Updating yum, installing Dev Tools..." echo "***********************" sudo yum -y groupinstall "Base" sudo yum -y groupinstall "GNOME Desktop" sudo yum -y groupinstall "Development Tools" echo "***********************" echo "Installing tools..." echo "***********************" sudo yum install -y git tar gcc vim unzip wget curl tree nginx if [ -d "/opt/$NODE" ] then echo "**********************************" echo "Node already installed..." echo "**********************************" else echo "**********************************" echo "Installing Node and update npm..." echo "**********************************" sudo cp /home/vagrant/provision/packages/$NODE.tar.xz /opt sudo tar -xpf /opt/$NODE.tar.xz -C /opt sudo echo "export PATH=\"$PATH:/opt/$NODE/bin\"" >> $HOME/.bash_profile sudo echo "export PATH=\"$PATH:/opt/$NODE/bin\"" >> /root/.bash_profile sudo source $HOME/.bash_profile fi echo "**********************************" echo "Installing Atom..." echo "**********************************" sudo rpm -ivh /home/vagrant/provision/packages/$ATOM.rpm echo "******************************" echo "Installing EPEL..." echo "******************************" wget -P /etc/yum.repos.d http://dl.fedoraproject.org/pub/epel/$EPEL sudo rpm -ivh /etc/yum.repos.d/$EPEL echo "***********************" echo "Git setup..." echo "***********************" git config --global user.email "[email protected]" git config --global user.name "Your Name" git config --global github.user "Username" echo "***********************" echo "Don't forget to:" echo "sudo visudo" echo "Append npm path to secure_path: /opt/$NODE/bin" echo "sudo npm install npm -g" echo "sudo npm install aurelia-cli -g" echo "***********************" echo "*********************************" echo "VM Provisioning Complete!" echo "*********************************"