-
-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathbootstrap.sh
More file actions
25 lines (20 loc) · 662 Bytes
/
bootstrap.sh
File metadata and controls
25 lines (20 loc) · 662 Bytes
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
#!/bin/bash
apt-get -y update
# Install N node version manager
apt-get -y install bash git curl make
curl -L https://git.io/n-install | su vagrant -c "bash -s -- -q lts"
. /home/vagrant/.bashrc
# Configure npm
cat <<EOF > /home/vagrant/.npmrc
loglevel=http
save-prefix=
EOF
# mount node_modules locally and make them persist through the reboot
mkdir -p /home/vagrant/node_modules
chown vagrant:vagrant /home/vagrant/node_modules
mount --bind /home/vagrant/node_modules/ /vagrant/node_modules
cat <<EOF >> /etc/fstab
/home/vagrant/node_modules/ /vagrant/node_modules none bind
EOF
# Change default CWD to /vagrant
echo "cd /vagrant" >> /home/vagrant/.bashrc