Xenial use -developer nodejs installer ; vars cleanup
authorBill Erickson <berickxx@gmail.com>
Fri, 13 May 2016 21:14:42 +0000 (17:14 -0400)
committerBill Erickson <berickxx@gmail.com>
Fri, 13 May 2016 21:14:42 +0000 (17:14 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
installer/16.04-xenial/eg_xenial_installer.sh

index 7827bd7..b16795f 100755 (executable)
@@ -15,6 +15,8 @@
 # -----------------------------------------------------------------------
 
 CLONE_DEPTH="--depth 1"
+OSRF_HOME=/home/opensrf/OpenSRF
+EG_HOME=/home/opensrf/Evergreen
 
 while getopts aystbdpc option
 do
@@ -107,11 +109,6 @@ function init_variables {
     echo EVERGREEN_PREREQ_TARGET=${EVERGREEN_PREREQ_TARGET}
     echo EVERGREEN_DB_PREREQ_TARGET=${EVERGREEN_DB_PREREQ_TARGET}
 
-    export NODEJS_REPO='https://github.com/joyent/node.git'
-    export NODEJS_VERSION='v0.10.31'
-    echo "NODEJS_REPO=$NODEJS_REPO"
-    echo "NODEJS_VERSION=$NODEJS_VERSION"
-
     echo End of intializing installer =~-._
 }
 
@@ -194,14 +191,14 @@ function cloning_git_repos {
     git clone $CLONE_DEPTH --branch $OPENSRF_BRANCH $OPENSRF_REPO OpenSRF;
     git clone $CLONE_DEPTH --branch $EVERGREEN_BRANCH $EVERGREEN_REPO Evergreen;
     "
-    rm -rf /home/opensrf/Evergreen /home/opensrf/OpenSRF
+    rm -rf $EG_HOME $OSRF_HOME
     su - opensrf sh -c "$OSRF_COMMAND";
     echo Return Value = $?
 
     # Show tips
-    cd /home/opensrf/OpenSRF/
+    cd $OSRF_HOME
     echo 'Tip of OpenSRF:' `git log --format=oneline | head -1`
-    cd /home/opensrf/Evergreen/
+    cd $EG_HOME/
     echo 'Tip of Evergreen:' `git log --format=oneline | head -1`
 
     echo End of cloning git repositories =~-._
@@ -214,9 +211,9 @@ function opensrf_prereqs {
     mkdir -p /usr/src/evergreen; 
     cd /usr/src/evergreen;
     if [ $YES ]; then
-        yes | make -f /home/opensrf/OpenSRF/src/extras/Makefile.install ${OPENSRF_PREREQ_TARGET}
+        yes | make -f $OSRF_HOME/src/extras/Makefile.install ${OPENSRF_PREREQ_TARGET}
     else
-        make -f /home/opensrf/OpenSRF/src/extras/Makefile.install ${OPENSRF_PREREQ_TARGET}
+        make -f $OSRF_HOME/src/extras/Makefile.install ${OPENSRF_PREREQ_TARGET}
     fi;
     echo Return Value = $?
     echo End of Installing OpenSRF pre-requisites =~-._
@@ -226,9 +223,9 @@ function evergreen_prereqs {
     echo _.-~= Installing Evergreen pre-requisites
     date
     if [ $YES ]; then
-        yes | make -f /home/opensrf/Evergreen/Open-ILS/src/extras/Makefile.install ${EVERGREEN_PREREQ_TARGET}
+        yes | make -f $EG_HOME/Open-ILS/src/extras/Makefile.install ${EVERGREEN_PREREQ_TARGET}
     else
-        make -f /home/opensrf/Evergreen/Open-ILS/src/extras/Makefile.install ${EVERGREEN_PREREQ_TARGET}
+        make -f $EG_HOME/Open-ILS/src/extras/Makefile.install ${EVERGREEN_PREREQ_TARGET}
     fi;
     echo Return Value = $?
     echo End of Installing Evergreen pre-requisites =~-._
@@ -260,9 +257,9 @@ function evergreen_db_prereqs {
         fi;
     else 
         if [ $YES ]; then
-            yes | make -f /home/opensrf/Evergreen/Open-ILS/src/extras/Makefile.install ${EVERGREEN_DB_PREREQ_TARGET}
+            yes | make -f $EG_HOME/Open-ILS/src/extras/Makefile.install ${EVERGREEN_DB_PREREQ_TARGET}
         else
-            make -f /home/opensrf/Evergreen/Open-ILS/src/extras/Makefile.install ${EVERGREEN_DB_PREREQ_TARGET}
+            make -f $EG_HOME/Open-ILS/src/extras/Makefile.install ${EVERGREEN_DB_PREREQ_TARGET}
         fi;
     fi;
     echo Return Value = $?
@@ -276,7 +273,7 @@ function setting_ldconfig_and_rsyslog_and_hosts_and_ejabberd {
     ldconfig;
     echo Return Value = $?
     # Configure rsyslog and restart
-    cp /home/opensrf/Evergreen/Open-ILS/examples/evergreen-rsyslog.conf /etc/rsyslog.d/evergreen.conf
+    cp $EG_HOME/Open-ILS/examples/evergreen-rsyslog.conf /etc/rsyslog.d/evergreen.conf
     service rsyslog restart
     echo Return Value = $?
     if [ ! "$(grep 'public.localhost' /etc/hosts)" ]; then
@@ -345,7 +342,7 @@ function build_opensrf {
 function test_opensrf_build {
     echo _.-~= Running OpenSRF build tests
     date
-    cd /home/opensrf/OpenSRF;
+    cd $OSRF_HOME;
     make check
     echo Return Value = $?
     echo End of OpenSRF build tests =~-._
@@ -377,7 +374,7 @@ function build_evergreen {
 function test_evergreen_build {
     echo _.-~= Running Evergreen build tests
     date
-    cd /home/opensrf/Evergreen
+    cd $EG_HOME
     make check
     echo Return Value = $?
     echo End of Evergreen build tests =~-._
@@ -393,19 +390,22 @@ function test_and_build_eg_browser_client {
         return;
     fi;
     echo _.-~= Running Evergreen browser client build/test
+
+    # install nodejs
+    if [ $YES ]; then
+        yes | make -f $EG_HOME/Open-ILS/src/extras/Makefile.install ${EVERGREEN_PREREQ_TARGET}-developer
+    else
+        make -f $EG_HOME/Open-ILS/src/extras/Makefile.install ${EVERGREEN_PREREQ_TARGET}-developer
+    fi;
+
     cd /tmp
-    git clone $NODEJS_REPO
-    cd node
-    git checkout -b $NODEJS_VERSION $NODEJS_VERSION
-    ./configure && make -j2 && make install
-    echo Return Value = $?
     npm update
     echo Return Value = $?
     npm install -g grunt-cli    # install grunt
     echo Return Value = $?
     npm install -g bower        # install bower
     echo Return Value = $?
-    cd /home/opensrf/Evergreen/Open-ILS/web/js/ui/default/staff
+    cd $EG_HOME/Open-ILS/web/js/ui/default/staff
     npm install                 # fetch build depencies
     echo Return Value = $?
 
@@ -428,7 +428,7 @@ function test_and_build_eg_browser_client {
 function install_evergreen {
     echo _.-~= Installing Evergreen
     date
-    cd /home/opensrf/Evergreen
+    cd $EG_HOME
     make install
     echo Return Value = $?
 
@@ -467,7 +467,7 @@ function configure_database {
     fi;
 
     # Apply the DB schema
-    cd /home/opensrf/Evergreen
+    cd $EG_HOME
     perl Open-ILS/src/support-scripts/eg_db_config \
         --create-database       \
         --create-schema         \
@@ -502,7 +502,7 @@ function configure_apache {
     date
     service apache2 stop
     # Copy apache configs into place and create SSL cert
-    cd /home/opensrf/Evergreen/
+    cd $EG_HOME
     cp Open-ILS/examples/apache_24/eg_24.conf       /etc/apache2/sites-available/eg.conf
     cp Open-ILS/examples/apache_24/eg_vhost_24.conf /etc/apache2/eg_vhost.conf
     cp Open-ILS/examples/apache/eg_startup          /etc/apache2/
@@ -577,7 +577,7 @@ function start_evergreen {
 
 function test_evergreen_live {
     # TODO: Eventually move these tests into a Make target within Evergreen
-    cd /home/opensrf/Evergreen
+    cd $EG_HOME
     echo _.-~= Running pgTAP tests
     date
     su - postgres -c 'cd /home/opensrf/Evergreen ; pg_prove -vr -d evergreen Open-ILS/src/sql/Pg/t/ ; echo Return Value = $?'