From 2599270593f22ade0f3d91ad2aa61731fe4a9004 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 12 Dec 2015 20:04:28 +0100 Subject: [PATCH 1/3] Install npm and frontend dependencies --- vagrant_bootstrap.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/vagrant_bootstrap.sh b/vagrant_bootstrap.sh index 1b8ac8f..773567a 100644 --- a/vagrant_bootstrap.sh +++ b/vagrant_bootstrap.sh @@ -1,6 +1,14 @@ #!/bin/bash +export DEBIAN_FRONTEND=noninteractive echo 'Installing required packages...' -sudo apt-get -yqq install git python3-pip python-dev libmysqlclient-dev libjpeg-dev +curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add - +DISTRO="vivid" +sudo sh -c "echo 'deb https://deb.nodesource.com/node_5.x ${DISTRO} main' > /etc/apt/sources.list.d/nodesource.list" +sudo sh -c "echo 'deb-src https://deb.nodesource.com/node_5.x ${DISTRO} main' >> /etc/apt/sources.list.d/nodesource.list" + +sudo apt-get update +sudo apt-get -yqq install git python3-pip python-dev libmysqlclient-dev libjpeg-dev \ + build-essential apt-transport-https nodejs cd /vagrant/backend echo 'Installing pip dependencies...' @@ -8,9 +16,9 @@ sudo pip3 install -r requirements.txt echo "Running migrations..." python3 manage.py migrate -# Todo: install npm; build app -# cd /vagrant/frontend - +cd /vagrant/frontend +sudo npm install -g tsd gulp +npm install --loglevel=info echo "" echo "Vagrant install complete." From 0a8b6090d6d3a5f0872e297ab24234886b21772c Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 12 Dec 2015 20:12:47 +0100 Subject: [PATCH 2/3] [Fix] Rename in Vagrantfile --- Vagrantfile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index c1fbf78..2292f69 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,29 +1,29 @@ # -*- mode: ruby -*- # vi: set ft=ruby : -Vagrant.configure("2") do |django_config| +Vagrant.configure("2") do |config| # Every Vagrant virtual environment requires a box to build off of. - django_config.vm.box = "ubuntu/vivid64" + config.vm.box = "ubuntu/vivid64" # Configure virtual machine specs. Keep it simple, single user. - django_config.vm.provider :virtualbox do |p| + config.vm.provider :virtualbox do |p| p.customize ["modifyvm", :id, "--memory", 1024] p.customize ["modifyvm", :id, "--cpus", 1] # p.customize ["modifyvm", :id, "--cpuexecutioncap", 50] end # Configure a synced folder between HOST and GUEST - django_config.vm.synced_folder "..", "/vagrant", id: "vagrant-root", :mount_options => ["dmode=777","fmode=666"] + config.vm.synced_folder "..", "/vagrant", id: "vagrant-root", :mount_options => ["dmode=777","fmode=666"] # Config hostname and IP address so entry can be added to HOSTS file - django_config.vm.hostname = "vagrant" - django_config.vm.network :private_network, ip: '192.168.87.7' + config.vm.hostname = "vagrant" + config.vm.network :private_network, ip: '192.168.87.7' # Forward a port from the guest to the host, which allows for outside # computers to access the VM, whereas host only networking does not. - django_config.vm.network "forwarded_port", guest: 8000, host: 8000 - django_config.vm.network "forwarded_port", guest: 5555, host: 5555 + config.vm.network "forwarded_port", guest: 8000, host: 8000 + config.vm.network "forwarded_port", guest: 5555, host: 5555 # kickoff a shell script to install Python essentials - django_config.vm.provision :shell, path: "vagrant_bootstrap.sh" + config.vm.provision :shell, path: "vagrant_bootstrap.sh" end From 4c6d17b5b66a60e59b0ba3abebf63c06a5748ed0 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 12 Dec 2015 20:24:14 +0100 Subject: [PATCH 3/3] Update README --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 5022237..5093c1e 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,6 @@ to launch the client: cd /vagrant/frontend npm start -*Warning: the client is not provisioned yet* - The backend and frontend will then be available at localhost:8000 and localhost:5555 on your host machine, and you can start coding as usual ! To reprovision the vagrant in case provisioning changed: