-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprovisioner.sh
executable file
·44 lines (31 loc) · 1.25 KB
/
provisioner.sh
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
#!/bin/bash
printf "Running Vagrant Provisioning..."
printf "Updating Box..."
# make sure the box is fully up to date
apt-get -y update
printf "Installing a few necessary packages..."
# install required packages
apt-get install -y git nodejs npm
printf "Installing nvm..."
# download package and switch to latest version
git clone --quiet https://github.com/creationix/nvm.git /home/vagrant/.nvm && cd /home/vagrant/.nvm
git checkout --quiet `git describe --abbrev=0 --tags`
# backup .bashrc since we're going to change it
cp /home/vagrant/.bashrc /home/vagrant/.bashrc.backup
# automatically source nvm from the .bashrc file on login
echo "source ~/.nvm/nvm.sh" >> /home/vagrant/.bashrc
# set the source of nvm for this session
source /home/vagrant/.nvm/nvm.sh
# install iojs with nvm
nvm install iojs
# make iojs default
nvm alias default iojs
# make sure npm is up to date
npm install -g npm
# remove old hash for npm so bash will find the new version
hash -d npm
# Needed for docs generation.
update-locale LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8
printf "Making sure ownership rights are correct in vagrant user directory..."
# make sure everything in the vagrant directory is owned by vagrant
chown -R vagrant:vagrant /home/vagrant --quiet