1 |
#!/bin/bash |
#!/bin/bash |
2 |
|
|
3 |
|
|
4 |
# npm install -g npm@next |
# 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 |
|
|
|
#BRANCH=next-release |
|
11 |
BRANCH=master |
BRANCH=master |
12 |
|
|
13 |
|
|
58 |
apt-get install build-essential || exit |
apt-get install build-essential || exit |
59 |
fi |
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 |
if [ ! -x "/usr/bin/redis-server" ] ; then |
67 |
echo "installing redis-server" |
echo "installing redis-server" |
68 |
apt-get install redis-server || exit |
apt-get install redis-server || exit |
69 |
fi |
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 |
if [ ! -x "/usr/local/bin/n" ] ; then |
87 |
|
|
88 |
if [ ! -x "/usr/local/bin/gulp" ] ; then |
if [ ! -x "/usr/local/bin/gulp" ] ; then |
89 |
echo "installing gulp" |
echo "installing gulp" |
90 |
npm install -g gulp |
npm install -g gulp || exit |
91 |
fi |
fi |
92 |
|
|
93 |
if [ ! -x "/usr/local/bin/forever" ] ; then |
if [ ! -x "/usr/local/bin/forever" ] ; then |
94 |
echo "installing forever" |
echo "installing forever" |
95 |
npm install -g forever |
npm install -g forever || exit |
96 |
fi |
fi |
97 |
|
|
98 |
if [ ! -x "/usr/local/bin/node-gyp" ] ; then |
if [ ! -x "/usr/local/bin/node-gyp" ] ; then |
99 |
echo "installing node-gyp" |
echo "installing node-gyp" |
100 |
npm install -g node-gyp |
npm install -g node-gyp || exit |
101 |
fi |
fi |
102 |
|
|
103 |
if [ ! -x "/usr/bin/git" ] ; then |
if [ ! -d "/usr/local/lib/node_modules/bcrypt" ] ; then |
104 |
echo "installing git" |
echo "installing bcrypt" |
105 |
apt-get install git |
npm install -g bcrypt || exit |
106 |
fi |
fi |
107 |
|
|
108 |
if [ ! -d "xo-web" ] ; then |
if [ ! -d "xo-web" ] ; then |
138 |
npm run build || exit |
npm run build || exit |
139 |
cd .. |
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 |
restartxo |
147 |
|
|
148 |
|
|