install-eg.sh: optionally use prebuilt/bundled web client dependencies instead of...
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Thu, 12 Apr 2018 22:04:14 +0000 (15:04 -0700)
committerJeff Davis <jdavis@sitka.bclibraries.ca>
Thu, 12 Apr 2018 22:04:14 +0000 (15:04 -0700)
deployment/install-eg.sh

index d71fc4c..60e3efc 100755 (executable)
@@ -22,12 +22,13 @@ suwrap() {
   su -s /bin/bash -c "source ~/.bashrc ; $1" $2
 }
 
-while getopts ":pecw" opt ; do
+while getopts ":pecwb" opt ; do
   case $opt in
     p ) PROD="prod";;
     e ) EDI="edi";;
     c ) CRONTAB="crontab";;
     w ) WEBCLIENT="webclient";;
+    b ) USEBUNDLE="usebundle";;
   esac
 done
 shift $(($OPTIND - 1))
@@ -69,9 +70,20 @@ fi
  
 # web client
 if [[ -n "$WEBCLIENT" ]] ; then
-  cd ${BUILDDIR}/Open-ILS/web/js/ui/default/staff/
-  suwrap "npm install" ${INSTALL_USER}
-  suwrap "bower install" ${INSTALL_USER}
+  if [[ -n "$USEBUNDLE" ]] ; then
+    # use bundled web client dependencies from upstream
+    if [ ! -d "/home/${INSTALL_USER}/web-client-deps" ] ; then
+      suwrap "cd /home/${INSTALL_USER} && git clone git://git.sitka.bclibraries.ca/sitka/web-client-deps web-client-deps" ${INSTALL_USER}
+    fi
+    suwrap "cd /home/${INSTALL_USER}/web-client-deps && git checkout ${STAMP_ID}" ${INSTALL_USER}
+    if [ -d "${BUILDDIR}/Open-ILS/web/js/ui/default/staff/build" ] ; then rm -rf ${BUILDDIR}/Open-ILS/web/js/ui/default/staff/build ; fi
+    suwrap "cp -r /home/${INSTALL_USER}/web-client-deps/build ${BUILDDIR}/Open-ILS/web/js/ui/default/staff/build" ${INSTALL_USER}
+  else
+    # install dependencies
+    cd ${BUILDDIR}/Open-ILS/web/js/ui/default/staff/
+    suwrap "npm install" ${INSTALL_USER}
+    suwrap "bower install" ${INSTALL_USER}
+  fi
   suwrap "grunt all" ${INSTALL_USER} || { echo 'Could not install files for web-based staff client' ; exit 1; }
 fi