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

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20