268568492be9978cb81e6962b556b0debaa4cd3c
[oweals/finalsclub.git] / setup.sh
1 #!/bin/bash
2
3 # this is sadly, out of date
4 # Bob, be bold and feel free to rewrite the old scripts rather than making new.sh
5
6 # TODO: Update this to install node 0.6.8 and whatever the latest stable mongodb is as of 02012-01-28 
7 # Will involve building node on linux, so be sure to install build-essential
8 # TODO: install the latest stable npm from their website
9 # don't use the latest git version, use the one from the npm site
10
11 ## Start to deploy instructions
12 # git clone pathto fc repo
13 # cd FinalsClub
14 ## checks out bc and EPL
15 # git submodule --update init
16 # npm install ./
17
18 # TODO: create separate deploy script for EPL
19 # should involve 'npm install ./'
20
21 sudo apt-get install git-core g++ libssl-dev curl make haproxy ruby rubygems mongodb-server
22
23 # install mongo_db
24 # Please change if running app on another arch!!!!
25
26 wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.0.2.tgz
27 tar -xvvf mongodb-linux-x86_64-2.0.2.tgz
28 cd mongodb-linux-x86_64-2.0.2
29 cp bin/* /usr/bin/*
30
31 cd ../
32
33 # Install node.js
34 curl http://nodejs.org/dist/node-v0.6.1.tar.gz > node-v0.6.1.tar.gz
35 tar xzvf node-v0.6.1.tar.gz
36 cd node-v0.6.1
37 sudo ./configure
38 sudo make
39 sudo make install
40 cd ..
41
42 # Install npm
43 git clone http://github.com/isaacs/npm.git
44 cd npm
45 sudo make install
46 sudo npm install nodemon -g
47 sudo npm install forever -g
48 cd /usr/bin
49 ln -sf /usr/local/bin/node .
50 sudo ln -sf /usr/local/bin/node .
51 sudo ln -sf /usr/local/bin/forever .
52
53 cd ~/
54
55 export PATH="/usr/local/bin:$PATH"
56
57 cd ~
58 rm -rf bc
59 git clone git://github.com/finalsclubdev/bc.git
60 cd ~/bc
61 npm install connect
62 npm install socket.io
63 npm install express-messages
64 npm install jade
65
66 cd ~
67 rm -rf FinalsClub
68 git clone git://github.com/finalsclubdev/FinalsClub.git
69 ln -sf FinalsClub fc
70
71 cd ~/fc
72 git checkout devel
73 git submodule init && git submodule update
74 npm install
75 cd etherpad-lite
76 npm install
77
78 # install some dependencies
79 cd ~/fc
80 npm install connect
81 npm install socket.io
82 npm install express-messages
83 npm install jade
84
85 echo "Please re-deploy DB backup before starting :)"
86
87 exit