Use nvm to install node 4 to vagrant env

This commit is contained in:
Kristian Tashkov
2016-01-10 12:50:52 +02:00
parent 193e89a79e
commit 37cabedecb
4 changed files with 42 additions and 20 deletions

0
.npmignore Normal file
View File

View File

@@ -16,5 +16,5 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.hostname = "habitrpg" config.vm.hostname = "habitrpg"
config.vm.network "forwarded_port", guest: 3000, host: 3000, auto_correct: true config.vm.network "forwarded_port", guest: 3000, host: 3000, auto_correct: true
config.vm.usable_port_range = (3000..3050) config.vm.usable_port_range = (3000..3050)
config.vm.provision :shell, :path => "vagrant.sh" config.vm.provision :shell, :path => "vagrant_scripts/vagrant.sh"
end end

19
vagrant_scripts/install.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
echo Installing nvm...
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.30.1/install.sh | bash
source ~/.profile
echo Setting up node...
nvm install
nvm use
nvm alias default current
echo Update npm...
npm install -g npm
echo Installing global modules...
npm install -g gulp bower grunt-cli
echo Installing Habitica...
npm install --no-bin-links

View File

@@ -38,6 +38,9 @@ apt-get update -qq
echo Installing Unix build tools - needed for node-gyp to use make... echo Installing Unix build tools - needed for node-gyp to use make...
apt-get install -qq build-essential apt-get install -qq build-essential
echo Installing python sofrware properties...
apt-get install -qq python-software-properties
echo Installing GraphicsMagick - provides gm and convert... echo Installing GraphicsMagick - provides gm and convert...
apt-get install -qq graphicsmagick apt-get install -qq graphicsmagick
@@ -59,19 +62,26 @@ apt-get update
apt-get install mongodb-10gen apt-get install mongodb-10gen
apt-get install -y mongodb-org=2.6.4 mongodb-org-server=2.6.4 mongodb-org-shell=2.6.4 mongodb-org-mongos=2.6.4 mongodb-org-tools=2.6.4 apt-get install -y mongodb-org=2.6.4 mongodb-org-server=2.6.4 mongodb-org-shell=2.6.4 mongodb-org-mongos=2.6.4 mongodb-org-tools=2.6.4
echo Adding PPA repository for gcc...
add-apt-repository ppa:ubuntu-toolchain-r/test
apt-get update -qq
echo Installing gcc 4.8...
apt-get install -qq gcc-4.8 g++-4.8
update-alternatives --remove-all gcc
update-alternatives --remove-all g++
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 20
update-alternatives --config gcc
update-alternatives --config g++
echo Installing Git... echo Installing Git...
apt-get install -qq git apt-get install -qq git
echo Installing npm... echo Installing curl...
apt-get install -qq python-software-properties apt-get install -qq curl
echo Adding repository node.js...
apt-add-repository -y ppa:chris-lea/node.js
echo Updating repositories...
apt-get update -qq
echo Installing node.js
apt-get install -qq nodejs
echo Updating npm...
npm install -g npm
echo Installing Xvfb... echo Installing Xvfb...
apt-get install -qq xvfb apt-get install -qq xvfb
echo Installing Java7... echo Installing Java7...
@@ -82,16 +92,9 @@ echo Installing Firefox...
dpkg -i firefox.deb dpkg -i firefox.deb
rm firefox.deb rm firefox.deb
cd /vagrant echo Installing ntp...
apt-get install -qq ntp
echo Installing gulp/bower...
npm install -g gulp grunt-cli bower
echo Installing Habitica
npm install --no-bin-links
echo Installing Bower packages
sudo -H -u vagrant bower --config.interactive=false install -f
## # echo Seeding Mongodb... ## # echo Seeding Mongodb...
## node ./src/seed.js ## node ./src/seed.js