/[projects]/misc/xoa-installer/xoa-installer.sh
ViewVC logotype

Contents of /misc/xoa-installer/xoa-installer.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2985 - (show annotations) (download) (as text)
Sat Mar 19 12:29:57 2016 UTC (8 years, 2 months ago) by torben
File MIME type: application/x-sh
File size: 2499 byte(s)
add note regarding raspbian
1 #!/bin/bash
2
3
4 # Note: this script works on debian 7 /wheezy
5 # I haven't yet managed to get it to work on deb8/jessie
6 # I running on a raspberry1 raspian/wheezy - downgrade node.js to 5.4.0
7
8 BRANCH=master
9
10
11 function restartxo {
12 killall -9 node
13 rm -f /root/forever.log
14 forever start -l /root/forever.log /root/xo-server/bin/xo-server
15 }
16
17 if [ "$1" == "restart" ] ; then
18 restartxo
19 exit
20 fi
21
22 if [ "$1" == "clean" ] ; then
23 echo cleaning xo-web
24 rm -rf xo-web
25
26 echo cleaning xo-server
27 rm -rf xo-server
28
29 echo cleaning .npm
30 rm -rf .npm
31
32 echo cleaning .node-gyp
33 rm -rf .node-gyp
34
35 echo cleaning .cache
36 rm -rf .cache
37
38 echo cleaning .forever
39 rm -rf .forever
40 rm -rf forever.log
41
42
43 echo done
44 exit
45 fi
46
47
48 if [ ! -x "/usr/bin/curl" ] ; then
49 echo "installing curl"
50 apt-get install curl || exit
51 fi
52
53 if [ ! -x "/usr/bin/gcc" ] ; then
54 echo "installing build-essential"
55 apt-get install build-essential || exit
56 fi
57
58 if [ ! -f "/usr/include/libpng12/png.h" ] ; then
59 echo "installing libpng"
60 apt-get install libpng12-dev
61 fi
62
63 if [ ! -x "/usr/bin/redis-server" ] ; then
64 echo "installing redis-server"
65 apt-get install redis-server || exit
66 fi
67
68 if [ ! -x "/usr/bin/git" ] ; then
69 echo "installing git"
70 apt-get install git
71 fi
72
73
74 if [ ! -x "/usr/local/bin/n" ] ; then
75 echo "installing node.js bootstrap"
76 curl -o /usr/local/bin/n https://raw.githubusercontent.com/visionmedia/n/master/bin/n || exit
77 chmod +x /usr/local/bin/n
78 fi
79
80 if [ ! -x "/usr/local/bin/node" ] ; then
81 echo "installing node.js"
82 n stable || exit
83 fi
84
85 if [ ! -x "/usr/local/bin/gulp" ] ; then
86 echo "installing gulp"
87 npm install -g gulp
88 fi
89
90 if [ ! -x "/usr/local/bin/forever" ] ; then
91 echo "installing forever"
92 npm install -g forever
93 fi
94
95 if [ ! -x "/usr/local/bin/node-gyp" ] ; then
96 echo "installing node-gyp"
97 npm install -g node-gyp
98 fi
99
100 if [ ! -d "/usr/local/lib/node_modules/bcrypt" ] ; then
101 echo "installing bcrypt"
102 npm install -g bcrypt
103 fi
104
105 if [ ! -d "xo-web" ] ; then
106 git clone -b $BRANCH https://github.com/vatesfr/xo-web.git
107 else
108 cd xo-web
109 git pull
110 cd ..
111 fi
112
113
114 if [ ! -d "xo-server" ] ; then
115 git clone -b $BRANCH https://github.com/vatesfr/xo-server.git
116 else
117 cd xo-server
118 git pull
119 cd ..
120 fi
121
122
123 # xo-server
124 echo "building xo-server"
125 cd xo-server
126 npm install || exit
127 npm run build || exit
128 cd ..
129
130
131 #xo-web
132 echo "building xo-web"
133 cd xo-web
134 npm install --unsafe-perm || exit
135 npm run build || exit
136 cd ..
137
138 if [ ! -f "/etc/xo-server/config.yaml" ] then
139 echo "please setup /etc/xo-server/config.yaml"
140 exit
141 fi
142
143 restartxo

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20