Merge pull request #1907 from gpazo/fixent-install
[xtuple] / update.sh
old mode 100644 (file)
new mode 100755 (executable)
index f8f5e79..345ff5f
--- a/update.sh
+++ b/update.sh
@@ -1,4 +1,4 @@
-#!/bin/bash 
+#!/bin/bash
 PRODUCTION=''
 HOST='localhost'
 
@@ -11,7 +11,7 @@ usage()
    -h target host
    -p production mode
 EOF
-}      
+}
 while getopts ":ph:" opt; do
   case $opt in
     p)
@@ -31,23 +31,23 @@ done
 # update source
 
 git checkout master
-#if [ $? ]
-#  then
-#    echo "error checking out master"
-#    exit $?
-#fi
-#exit
+if [ $? != 0  ]
+  then
+    echo "error checking out master"
+    exit $?
+fi
+
 git pull
-#if [ $? ]
-#  then
-#    echo "error pulling master"
-#    exit $?
-#fi
+if [ $? != 0  ]
+  then
+    echo "error pulling master"
+    exit $?
+fi
 
 if [ $PRODUCTION ]
   then
   git checkout `git describe --abbrev=0`
-  if [ $? ]
+  if [ $? != 0  ]
     then
       echo "error checking out latest tag"
       exit $?
@@ -56,36 +56,15 @@ fi
 
 # update libraries
 git submodule update --init --recursive
-#if [ $? ]
-#  then
-#    echo "error updating submodules"
-#    exit $?
-#fi
-cd node-datasource
-npm install
-
-# restart the datasource
-monit stop node
-sleep 10
-monit start node
-sleep 10
-
-# update global db
-cd database/source
-psql -U admin  -h $HOST global -f init_global.sql
-cd ../../installer
-./installer.js -h $HOST -d global -u admin -p 5432 -P admin --path ../database/orm
-
-# update instance dbs
-cd ..
-node runMaintenance.js
+if [ $? != 0  ]
+  then
+    echo "error updating submodules"
+    exit $?
+fi
 
-# build extensions
-cd ../enyo-client/extensions
-./tools/buildExtensions.sh
+# remove all npm packages and reinstall them to get the latest.
+rm -rf node_modules
+npm install
 
-# deploy enyo client
-cd ../application
-rm -rf deploy
-cd tools
-./deploy.sh
+# rebuild the client and database sides of the app
+./scripts/build_app.js