7 |
# Please note that raspian/wheezy for arm defaults to gcc 4.6 |
# Please note that raspian/wheezy for arm defaults to gcc 4.6 |
8 |
# gcc 4.7 is needed for compiling node-js modules |
# gcc 4.7 is needed for compiling node-js modules |
9 |
|
|
10 |
BRANCH=master |
BRANCH=stable |
11 |
|
|
12 |
|
|
13 |
|
################################### |
14 |
|
# Exit bash if a command fails |
15 |
|
set -e |
16 |
|
# also exit if a part of a pipe fails |
17 |
|
set -o pipefail |
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
function restartxo { |
function restartxo { |
34 |
echo cleaning xo-web |
echo cleaning xo-web |
35 |
rm -rf xo-web |
rm -rf xo-web |
36 |
|
|
37 |
|
# echo cleaning xo-web-v4 |
38 |
|
# rm -rf xo-web-v4 |
39 |
|
|
40 |
echo cleaning xo-server |
echo cleaning xo-server |
41 |
rm -rf xo-server |
rm -rf xo-server |
42 |
|
|
124 |
cd .. |
cd .. |
125 |
fi |
fi |
126 |
|
|
127 |
|
#if [ ! -d "xo-web-v4" ] ; then |
128 |
|
# git clone -b $BRANCH https://github.com/vatesfr/xo-web.git xo-web-v4 |
129 |
|
# cd xo-web-v4 |
130 |
|
# git checkout tags/v4.16.0 |
131 |
|
# cd .. |
132 |
|
#fi |
133 |
|
|
134 |
if [ ! -d "xo-server" ] ; then |
if [ ! -d "xo-server" ] ; then |
135 |
git clone -b $BRANCH https://github.com/vatesfr/xo-server.git |
git clone -b $BRANCH https://github.com/vatesfr/xo-server.git |
160 |
#xo-web |
#xo-web |
161 |
echo "building xo-web" |
echo "building xo-web" |
162 |
cd xo-web |
cd xo-web |
163 |
npm install --unsafe-perm || exit |
#npm install --unsafe-perm || exit |
164 |
|
npm install || exit |
165 |
npm run build || exit |
npm run build || exit |
166 |
cd .. |
cd .. |
167 |
|
|
168 |
|
##xo-web-v4 |
169 |
|
#echo "building xo-web-v4" |
170 |
|
#cd xo-web-v4 |
171 |
|
# npm install || exit |
172 |
|
# npm run build || exit |
173 |
|
#cd .. |
174 |
|
|
175 |
|
|
176 |
|
|
177 |
|
#if [ ! -f xo-web/dist/styles/main.css ] ; then |
178 |
|
# mkdir xo-web/dist/styles |
179 |
|
# mkdir xo-web/dist/images |
180 |
|
# |
181 |
|
# cp xo-web-v4/dist/styles/main.css xo-web/dist/styles/main.css |
182 |
|
# cp xo-web-v4/dist/images/logo_small.png xo-web/dist/images/logo_small.png |
183 |
|
#fi |
184 |
|
|
185 |
|
|
186 |
if [ ! -f "/etc/xo-server/config.yaml" ] ; then |
if [ ! -f "/etc/xo-server/config.yaml" ] ; then |
187 |
if [ ! -d "/etc/xo-server" ] ; then |
if [ ! -d "/etc/xo-server" ] ; then |
192 |
exit |
exit |
193 |
fi |
fi |
194 |
|
|
195 |
restartxo |
echo Installing plugins |
196 |
|
npm install --global xo-server-transport-email |
197 |
|
npm install --global xo-server-transport-xmpp |
198 |
|
npm install --global xo-server-backup-reports |
199 |
|
|
200 |
|
#npm install --save xo-server-usage-report |
201 |
|
|
202 |
|
|
203 |
|
#restartxo |
204 |
|
|
205 |
|
|