forked from swarmsim/swarm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·36 lines (33 loc) · 1.25 KB
/
install.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
#!/bin/sh -eux
# Install swarmsim on a new ubuntu machine. Tested on ec2 ubuntu 14.04.
# For ec2, first open port 9000 in the 3c2 firewall:
# - directions: http://stackoverflow.com/questions/17161345/how-to-open-a-web-server-port-on-ec2-instance
# - security group: https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#SecurityGroups:sort=groupId
#
# Usage:
#
# curl https://raw.githubusercontent.com/swarmsim/swarm/master/install.sh | sh
#
# first, all the sudo stuff.
sudo apt-get update
# nodejs-legacy symlinks nodejs -> node, like node built from source in every other non-debian system
# ruby-dev needed to build compass
sudo apt-get install -y git nodejs nodejs-legacy npm ruby ruby-dev phantomjs
sudo npm install -g yo generator-angular grunt-cli bower
sudo gem install compass
# updates too.
sudo npm update -g yo generator-angular grunt-cli bower
sudo npm cache clean
# check out the package and install its deps.
# assume we're running locally if the current dir is named 'swarm'.
if [ "`basename $PWD`" != "swarm" ]; then
test -d swarm || git clone https://github.com/erosson/swarm.git
cd swarm
fi
npm install || sudo npm install
yes | bower install
# everything's installed! test it.
grunt
grunt build
grunt test
# `grunt serve` to run on port 9000.