Checking in changes made in-place on the server to be merged
[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 npm install connect
58 npm install socket.io
59 npm install express-messages
60 npm install jade
61
62 cd ~
63 rm -rf FinalsClub
64 git clone git://github.com/finalsclubdev/FinalsClub.git
65 ln -sf FinalsClub fc
66
67 cd ~/fc
68 git checkout devel
69 git submodule init && git submodule update
70 npm install
71 cd etherpad-lite
72 npm install
73
74 # install some dependencies
75 cd ~/fc
76 npm install connect
77 npm install socket.io
78 npm install express-messages
79 npm install jade
80
81 echo "Please re-deploy DB backup before starting :)"
82
83 exit