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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2989 - (hide annotations) (download) (as text)
Mon Mar 28 15:43:06 2016 UTC (8 years, 2 months ago) by torben
File MIME type: application/x-sh
File size: 2668 byte(s)
add comments about gcc on raspian
1 torben 2956 #!/bin/bash
2    
3    
4 torben 2983 # Note: this script works on debian 7 /wheezy
5     # I haven't yet managed to get it to work on deb8/jessie
6 torben 2989 #
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 torben 2956
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 torben 2957
51 torben 2958 if [ ! -x "/usr/bin/curl" ] ; then
52     echo "installing curl"
53     apt-get install curl || exit
54     fi
55    
56 torben 2961 if [ ! -x "/usr/bin/gcc" ] ; then
57     echo "installing build-essential"
58     apt-get install build-essential || exit
59     fi
60 torben 2962
61 torben 2983 if [ ! -f "/usr/include/libpng12/png.h" ] ; then
62     echo "installing libpng"
63 torben 2986 apt-get install libpng12-dev || exit
64 torben 2983 fi
65    
66 torben 2962 if [ ! -x "/usr/bin/redis-server" ] ; then
67     echo "installing redis-server"
68     apt-get install redis-server || exit
69     fi
70 torben 2980
71     if [ ! -x "/usr/bin/git" ] ; then
72     echo "installing git"
73 torben 2986 apt-get install git || exit
74 torben 2980 fi
75 torben 2961
76    
77 torben 2957 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 torben 2958 n stable || exit
86 torben 2957 fi
87    
88 torben 2959 if [ ! -x "/usr/local/bin/gulp" ] ; then
89     echo "installing gulp"
90 torben 2986 npm install -g gulp || exit
91 torben 2959 fi
92 torben 2957
93 torben 2963 if [ ! -x "/usr/local/bin/forever" ] ; then
94     echo "installing forever"
95 torben 2986 npm install -g forever || exit
96 torben 2963 fi
97 torben 2957
98 torben 2979 if [ ! -x "/usr/local/bin/node-gyp" ] ; then
99     echo "installing node-gyp"
100 torben 2986 npm install -g node-gyp || exit
101 torben 2979 fi
102    
103 torben 2982 if [ ! -d "/usr/local/lib/node_modules/bcrypt" ] ; then
104 torben 2981 echo "installing bcrypt"
105 torben 2986 npm install -g bcrypt || exit
106 torben 2981 fi
107 torben 2959
108 torben 2956 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 torben 2959 echo "building xo-server"
128 torben 2956 cd xo-server
129 torben 2959 npm install || exit
130 torben 2956 npm run build || exit
131     cd ..
132    
133    
134     #xo-web
135 torben 2959 echo "building xo-web"
136 torben 2956 cd xo-web
137     npm install --unsafe-perm || exit
138     npm run build || exit
139     cd ..
140    
141 torben 2984 if [ ! -f "/etc/xo-server/config.yaml" ] then
142     echo "please setup /etc/xo-server/config.yaml"
143     exit
144     fi
145    
146 torben 2956 restartxo

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20