--- misc/xoa-installer/xoa-installer.sh 2016/02/29 09:39:36 2957 +++ misc/xoa-installer/xoa-installer.sh 2016/03/19 12:43:25 2986 @@ -1,9 +1,10 @@ #!/bin/bash -# npm install -g npm@next +# Note: this script works on debian 7 /wheezy +# I haven't yet managed to get it to work on deb8/jessie +# I running on a raspberry1 raspian/wheezy - downgrade node.js to 5.4.0 -#BRANCH=next-release BRANCH=master @@ -44,6 +45,32 @@ fi +if [ ! -x "/usr/bin/curl" ] ; then + echo "installing curl" + apt-get install curl || exit +fi + +if [ ! -x "/usr/bin/gcc" ] ; then + echo "installing build-essential" + apt-get install build-essential || exit +fi + +if [ ! -f "/usr/include/libpng12/png.h" ] ; then + echo "installing libpng" + apt-get install libpng12-dev || exit +fi + +if [ ! -x "/usr/bin/redis-server" ] ; then + echo "installing redis-server" + apt-get install redis-server || exit +fi + +if [ ! -x "/usr/bin/git" ] ; then + echo "installing git" + apt-get install git || exit +fi + + if [ ! -x "/usr/local/bin/n" ] ; then echo "installing node.js bootstrap" curl -o /usr/local/bin/n https://raw.githubusercontent.com/visionmedia/n/master/bin/n || exit @@ -52,10 +79,28 @@ if [ ! -x "/usr/local/bin/node" ] ; then echo "installing node.js" - n stable + n stable || exit fi +if [ ! -x "/usr/local/bin/gulp" ] ; then + echo "installing gulp" + npm install -g gulp || exit +fi + +if [ ! -x "/usr/local/bin/forever" ] ; then + echo "installing forever" + npm install -g forever || exit +fi + +if [ ! -x "/usr/local/bin/node-gyp" ] ; then + echo "installing node-gyp" + npm install -g node-gyp || exit +fi +if [ ! -d "/usr/local/lib/node_modules/bcrypt" ] ; then + echo "installing bcrypt" + npm install -g bcrypt || exit +fi if [ ! -d "xo-web" ] ; then git clone -b $BRANCH https://github.com/vatesfr/xo-web.git @@ -76,18 +121,25 @@ # xo-server +echo "building xo-server" cd xo-server -npm install --unsafe-perm || exit +npm install || exit npm run build || exit cd .. #xo-web +echo "building xo-web" cd xo-web npm install --unsafe-perm || exit npm run build || exit cd .. +if [ ! -f "/etc/xo-server/config.yaml" ] then + echo "please setup /etc/xo-server/config.yaml" + exit +fi + restartxo