10 |
BRANCH=stable |
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 { |
23 |
killall -9 node |
killall -9 node |
24 |
rm -f /root/forever.log |
rm -f /root/forever.log |
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 |
# echo cleaning xo-web-v4 |
38 |
rm -rf xo-web-v4 |
# rm -rf xo-web-v4 |
39 |
|
|
40 |
echo cleaning xo-server |
echo cleaning xo-server |
41 |
rm -rf xo-server |
rm -rf xo-server |
124 |
cd .. |
cd .. |
125 |
fi |
fi |
126 |
|
|
127 |
if [ ! -d "xo-web-v4" ] ; then |
#if [ ! -d "xo-web-v4" ] ; then |
128 |
git clone -b $BRANCH https://github.com/vatesfr/xo-web.git xo-web-v4 |
# git clone -b $BRANCH https://github.com/vatesfr/xo-web.git xo-web-v4 |
129 |
cd xo-web-v4 |
# cd xo-web-v4 |
130 |
git checkout tags/v4.16.0 |
# git checkout tags/v4.16.0 |
131 |
cd .. |
# cd .. |
132 |
fi |
#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 |
165 |
npm run build || exit |
npm run build || exit |
166 |
cd .. |
cd .. |
167 |
|
|
168 |
#xo-web-v4 |
##xo-web-v4 |
169 |
echo "building xo-web-v4" |
#echo "building xo-web-v4" |
170 |
cd xo-web-v4 |
#cd xo-web-v4 |
171 |
npm install || exit |
# npm install || exit |
172 |
npm run build || exit |
# npm run build || exit |
173 |
cd .. |
#cd .. |
|
|
|
174 |
|
|
175 |
|
|
|
if [ ! -f xo-web/dist/styles/main.css ] ; then |
|
|
mkdir xo-web/dist/styles |
|
|
mkdir xo-web/dist/images |
|
176 |
|
|
177 |
cp xo-web-v4/dist/styles/main.css xo-web/dist/styles/main.css |
#if [ ! -f xo-web/dist/styles/main.css ] ; then |
178 |
cp xo-web-v4/dist/images/logo_small.png xo-web/dist/images/logo_small.png |
# mkdir xo-web/dist/styles |
179 |
fi |
# 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 |
192 |
exit |
exit |
193 |
fi |
fi |
194 |
|
|
195 |
|
echo Installing plugins |
196 |
|
npm install --global xo-server-transport-email |
197 |
|
npm install --global xo-server-transport-xmpp |
198 |
|
#npm install --save xo-server-usage-report |
199 |
|
|
200 |
|
|
201 |
#restartxo |
#restartxo |
202 |
|
|
203 |
|
|