--- misc/xoa-installer/xoa-installer.sh 2017/01/03 15:16:14 3186 +++ misc/xoa-installer/xoa-installer.sh 2018/04/11 12:44:28 3226 @@ -10,6 +10,8 @@ BRANCH=stable +#Uncomment next line if you want to trick into building enterprise version +#export XOA_PLAN=4 ################################### # Exit bash if a command fails @@ -19,17 +21,6 @@ -function restartxo { - killall -9 node - rm -f /root/forever.log - forever start -l /root/forever.log /root/xo-server/bin/xo-server -} - -if [ "$1" == "restart" ] ; then - restartxo - exit -fi - phymem=$(free -m|awk '/^Mem:/{print $2}') swapmem=$(free -m|awk '/^Swap:/{print $2}') @@ -40,12 +31,15 @@ fi if [ "$1" == "clean" ] ; then + echo cleaning global npm packages + npm uninstall -g gulp + npm uninstall -g node-gyp + npm uninstall -g bcrypt + npm uninstall -g yarn + echo cleaning xo-web rm -rf xo-web -# echo cleaning xo-web-v4 -# rm -rf xo-web-v4 - echo cleaning xo-server rm -rf xo-server @@ -58,11 +52,6 @@ echo cleaning .cache rm -rf .cache - echo cleaning .forever - rm -rf .forever - rm -rf forever.log - - echo done exit fi @@ -105,91 +94,49 @@ n lts || 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/gulp" ] ; then +# echo "installing gulp" +# npm install -g gulp || exit +#fi -if [ ! -x "/usr/local/bin/node-gyp" ] ; then - echo "installing node-gyp" - npm install -g node-gyp || exit +if [ ! -x "/usr/local/bin/yarn" ] ; then + echo "installing yarn" + npm install -g yarn || exit fi -if [ ! -d "/usr/local/lib/node_modules/bcrypt" ] ; then - echo "installing bcrypt" - npm install -g --unsafe-perm bcrypt || exit -fi -if [ ! -d "xo-web" ] ; then - git clone -b $BRANCH https://github.com/vatesfr/xo-web.git -else - cd xo-web - git pull - cd .. -fi +#if [ ! -x "/usr/local/bin/node-gyp" ] ; then +# echo "installing node-gyp" +# npm install -g node-gyp || exit +#fi -#if [ ! -d "xo-web-v4" ] ; then -# git clone -b $BRANCH https://github.com/vatesfr/xo-web.git xo-web-v4 -# cd xo-web-v4 -# git checkout tags/v4.16.0 -# cd .. +#if [ ! -d "/usr/local/lib/node_modules/bcrypt" ] ; then +# echo "installing bcrypt" +# npm install -g --unsafe-perm bcrypt || exit #fi -if [ ! -d "xo-server" ] ; then - git clone -b $BRANCH https://github.com/vatesfr/xo-server.git + + +if [ ! -d "xen-orchestra" ] ; then + git clone -b $BRANCH https://github.com/vatesfr/xen-orchestra.git else - cd xo-server + cd xen-orchestra git pull cd .. fi -# xo-server -echo "building xo-server" -cd xo-server - npm install --unsafe-perm || exit - npm run build || exit - - #for some reasone leveldown fails occasionally on arm/raspberry pi - if [ ! -d "/root/xo-server/node_modules/leveldown/build" ] ; then - pushd node_modules/leveldown - node-gyp configure || exit - node-gyp build || exit - popd - fi -cd .. - -#xo-web -echo "building xo-web" -cd xo-web - npm install --unsafe-perm || exit - npm run build || exit +# xo-server +echo "building xen-orchestra" +cd xen-orchestra + yarn + yarn build cd .. -##xo-web-v4 -#echo "building xo-web-v4" -#cd xo-web-v4 -# npm install || exit -# npm run build || exit -#cd .. - -#if [ ! -f xo-web/dist/styles/main.css ] ; then -# mkdir xo-web/dist/styles -# mkdir xo-web/dist/images -# -# cp xo-web-v4/dist/styles/main.css xo-web/dist/styles/main.css -# cp xo-web-v4/dist/images/logo_small.png xo-web/dist/images/logo_small.png -#fi - dir=`dirname $0` if [ ! -f "/etc/xo-server/config.yaml" ] ; then