/[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 2984 - (hide annotations) (download) (as text)
Sat Mar 19 12:02:38 2016 UTC (8 years, 2 months ago) by torben
File MIME type: application/x-sh
File size: 2428 byte(s)
make sure config is in place
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 2956
7 torben 2983
8 torben 2956 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 torben 2957
48 torben 2958 if [ ! -x "/usr/bin/curl" ] ; then
49     echo "installing curl"
50     apt-get install curl || exit
51     fi
52    
53 torben 2961 if [ ! -x "/usr/bin/gcc" ] ; then
54     echo "installing build-essential"
55     apt-get install build-essential || exit
56     fi
57 torben 2962
58 torben 2983 if [ ! -f "/usr/include/libpng12/png.h" ] ; then
59     echo "installing libpng"
60     apt-get install libpng12-dev
61     fi
62    
63 torben 2962 if [ ! -x "/usr/bin/redis-server" ] ; then
64     echo "installing redis-server"
65     apt-get install redis-server || exit
66     fi
67 torben 2980
68     if [ ! -x "/usr/bin/git" ] ; then
69     echo "installing git"
70     apt-get install git
71     fi
72 torben 2961
73    
74 torben 2957 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 torben 2958 n stable || exit
83 torben 2957 fi
84    
85 torben 2959 if [ ! -x "/usr/local/bin/gulp" ] ; then
86     echo "installing gulp"
87 torben 2960 npm install -g gulp
88 torben 2959 fi
89 torben 2957
90 torben 2963 if [ ! -x "/usr/local/bin/forever" ] ; then
91     echo "installing forever"
92     npm install -g forever
93     fi
94 torben 2957
95 torben 2979 if [ ! -x "/usr/local/bin/node-gyp" ] ; then
96     echo "installing node-gyp"
97     npm install -g node-gyp
98     fi
99    
100 torben 2982 if [ ! -d "/usr/local/lib/node_modules/bcrypt" ] ; then
101 torben 2981 echo "installing bcrypt"
102     npm install -g bcrypt
103     fi
104 torben 2959
105 torben 2956 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 torben 2959 echo "building xo-server"
125 torben 2956 cd xo-server
126 torben 2959 npm install || exit
127 torben 2956 npm run build || exit
128     cd ..
129    
130    
131     #xo-web
132 torben 2959 echo "building xo-web"
133 torben 2956 cd xo-web
134     npm install --unsafe-perm || exit
135     npm run build || exit
136     cd ..
137    
138 torben 2984 if [ ! -f "/etc/xo-server/config.yaml" ] then
139     echo "please setup /etc/xo-server/config.yaml"
140     exit
141     fi
142    
143 torben 2956 restartxo

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20