Skip to content

Commit

Permalink
Merge pull request #83 from DiscoStarslayer/vagrant-fixes
Browse files Browse the repository at this point in the history
Vagrant Bootstrap Fixes
  • Loading branch information
anp authored Sep 22, 2016
2 parents f2f3c58 + 1059903 commit 1fc6409
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ $ cd /vagrant && cargo run -- scrape
To install dependencies for the front-end development server and run it:

```
$ cd /vagrant/front && npm install && bower install
$ cd /vagrant/front
$ ember server --proxy=http://localhost:8080
```

Expand Down
5 changes: 5 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ Vagrant.configure("2") do |config|
path: "vagrant/native_deps.sh",
keep_color: true)

config.vm.provision("frontend",
type: "shell",
path: "vagrant/frontend.sh",
keep_color: true)

config.vm.provision("postgres",
type: "shell",
path: "vagrant/postgres.sh",
Expand Down
21 changes: 21 additions & 0 deletions vagrant/frontend.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

set -e

# global deps
npm install -g ember-cli
npm install -g bower

# keep node modules in VM file system to speedup npm install and fix it on Windows/Linux machines
mkdir -p /home/vagrant/local_front/node_modules
rm -f /vagrant/front/node_modules || true
ln -s /home/vagrant/local_front/node_modules /vagrant/front/
chown -R vagrant:vagrant /home/vagrant/local_front
chown -R vagrant:vagrant /vagrant/front/node_modules

# install local deps
su vagrant <<'EOF'
cd /vagrant/front
npm install
bower install
EOF
4 changes: 0 additions & 4 deletions vagrant/native_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,3 @@ locale-gen en_US.UTF-8
apt-get update
apt-get install -y postgresql libpq-dev npm nodejs curl git
ln -s /usr/bin/nodejs /usr/bin/node

# frontend deps
npm install -g ember-cli
npm install -g bower
1 change: 1 addition & 0 deletions vagrant/vagrant_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export GITHUB_SCRAPE_INTERVAL=2
export RELEASES_SCRAPE_INTERVAL=720
export BUILDBOT_SCRAPE_INTERVAL=80
export SERVER_PORT=8080
export POST_COMMENTS=false

# VM config for cargo
export CARGO_TARGET_DIR=/rust-dashboard/target
Expand Down

0 comments on commit 1fc6409

Please sign in to comment.