remove cruft
authorJason Etheridge <jason@equinoxinitiative.org>
Mon, 28 Jan 2019 04:00:35 +0000 (23:00 -0500)
committerJason Etheridge <jason@equinoxinitiative.org>
Mon, 28 Jan 2019 04:00:35 +0000 (23:00 -0500)
installer/stretch/eg_stretch_installer.sh

index 3e0a95e..046dd7c 100755 (executable)
@@ -938,6 +938,14 @@ function evergreen_db_pgtap {
     echo End of pgTAP tests =~-._
 }
 
+function eg_autogen {
+    echo _.-~= Running autogen.sh
+    date
+    su - opensrf sh -c "PATH=$PATH:/openils/bin autogen.sh";
+    echo Return Value = $?
+    echo End of Running autogen.sh =~-._
+}
+
 function eg_restart_apache {
     echo _.-~= Restarting Apache
     date
@@ -972,14 +980,6 @@ function eg_restart_apache {
     echo End of Restarting Apache =~-._
 }
 
-function eg_autogen {
-    echo _.-~= Running autogen.sh
-    date
-    su - opensrf sh -c "PATH=$PATH:/openils/bin autogen.sh";
-    echo Return Value = $?
-    echo End of Running autogen.sh =~-._
-}
-
 function eg_test_srfsh {
     echo _.-~= test EG opensrf
     OSRF_COMMAND="echo login $ADMIN_USER $ADMIN_PASS | PATH=/openils/bin:\$PATH srfsh"
@@ -988,242 +988,6 @@ function eg_test_srfsh {
     echo End of test EG opensrf =~-._
 }
 
-function get_opensrf_tip {
-    cd /home/test/OpenSRF/
-    echo 'Tip of OpenSRF:' `git log --format=oneline | head -1`
-}
-
-function get_eg_tip {
-    cd /home/test/Evergreen/
-    echo 'Tip of Evergreen:' `git log --format=oneline | head -1`
-}
-
-function docs_builder_prereqs {
-    echo _.-~= Installing prereqs for building the documentation formats
-    date
-    # Install tools used for building the docs
-    apt-get -yq install asciidoc source-highlight fop;
-    echo Return Value = $?
-
-    echo End of Installing prereqs for building the documentation formats =~-._
-}
-
-function build_the_docs {
-    echo _.-~= Building the AsciiDoc output formats
-    date
-    # build HTML
-    su - test sh -c 'cd /home/test/Evergreen/docs/ ; asciidoc root.adoc ; echo Return Value = $?'
-    # build PDF
-    su - test sh -c 'cd /home/test/Evergreen/docs/ ; a2x --fop --fop-opts="-q" root.adoc ; echo Return Value = $?'
-    # build EPUB
-    su - test sh -c 'cd /home/test/Evergreen/docs/ ; a2x --no-xmllint --format epub root.adoc ; echo Return Value = $?'
-
-    echo End of Building the AsciiDoc output formats =~-._
-}
-
-function show_git_tips {
-    # Show tips
-    cd /home/test/OpenSRF/
-    echo 'Tip of OpenSRF:' `git log --format=oneline | head -1`
-    cd /home/test/Evergreen/
-    echo 'Tip of Evergreen:' `git log --format=oneline | head -1`
-}
-
-
-function setting_ldconfig_and_rsyslog_and_hosts_and_ejabberd {
-    echo _.-~= setting ld.so.conf and rsyslog and /etc/hosts and ejabberd
-    date
-    cp $BASE_DIR/evergreen.ld.conf /etc/ld.so.conf.d/
-    ldconfig;
-    echo Return Value = $?
-    # Configure rsyslog and restart
-    cp /home/opensrf/Evergreen/Open-ILS/examples/evergreen-rsyslog.conf /etc/rsyslog.d/evergreen.conf
-    /etc/init.d/rsyslog restart
-    echo Return Value = $?
-    # Patch Ejabberd and register users
-    if [ ! "$(grep 'public.localhost' /etc/ejabberd/ejabberd.yml)" ]; then
-        cd /etc/ejabberd/
-        /etc/init.d/ejabberd stop;
-        killall beam epmd; # just in case
-        cp ejabberd.yml /root/ejabberd.yml
-        patch -p0 < $BASE_DIR/ejabberd.EG.patch
-        chown ejabberd:ejabberd ejabberd.yml
-        echo starting ejabberd after patching
-        date
-        /etc/init.d/ejabberd start
-        echo Return Value = $?
-        sleep 10;
-        ejabberdctl register router  private.localhost $JABBER_PASSWORD
-        echo Return Value = $?
-        ejabberdctl register opensrf private.localhost $JABBER_PASSWORD
-        echo Return Value = $?
-        ejabberdctl register router  public.localhost  $JABBER_PASSWORD
-        echo Return Value = $?
-        ejabberdctl register opensrf public.localhost  $JABBER_PASSWORD
-        echo Return Value = $?
-    fi;
-    echo End of setting ld.so.conf and rsyslog and /etc/hosts and ejabberd =~-._
-}
-
-function build_evergreen {
-    echo _.-~= Building Evergreen
-    date
-    OSRF_COMMAND='
-    export PATH=/openils/bin:$PATH
-    cd /home/opensrf/Evergreen;
-    autoreconf -i;
-    ./configure --prefix=/openils --sysconfdir=/openils/conf;
-    make;
-    '
-    su - opensrf sh -c "$OSRF_COMMAND"
-    echo Return Value = $?
-    echo End of Building Evergreen =~-._
-}
-
-function test_evergreen_build {
-    echo _.-~= Running Evergreen build tests
-    date
-    cd /home/opensrf/Evergreen
-    make check
-    echo Return Value = $?
-    echo End of Evergreen build tests =~-._
-}
-
-
-# The evergreen browser client prereq installation and 
-# build process is not baked into Evergreen proper (yet).  
-# Run it as a standalone operation for now.
-function test_and_build_eg_browser_client {
-    echo _.-~= Running Evergreen browser client build/test
-    cd /home/opensrf && pwd
-    wget -N $NODEJS_BINARY
-    tar xf $NODEJS_TARBIN
-    echo Return Value = $?
-    export PATH=$PATH:/home/opensrf/$NODEJS_BINDIR/bin
-    echo Return Value = $?
-    echo Running npm update
-    npm update
-    echo Return Value = $?
-    echo Running npm i npm@latest -g
-    npm i npm@latest -g
-    echo Return Value = $?
-    echo Running npm audit
-    npm audit
-    echo Return Value = $?
-    cd /home/opensrf/Evergreen/Open-ILS/web/js/ui/default/staff && pwd
-    echo Running npm install
-    npm install                 # fetch build depencies
-    echo Return Value = $?
-    echo Running npm run build
-    npm run build                 # copy into place; use build-prod for concatenation
-    echo Return Value = $?
-    echo Running npm test
-    npm run test                  # run JS unit tests
-    echo Return Value = $?
-    cd /home/opensrf/Evergreen/Open-ILS/src/eg2/ && pwd
-    echo Running npm install
-    npm install                 # fetch build depencies
-    echo Return Value = $?
-    echo Running ng build --prod
-    ng build --prod             # for ang6
-    echo Return Value = $?
-    echo Running npm test
-    npm run test                  # run JS unit tests
-    echo Return Value = $?
-    echo End of Evergreen browser client build/test =~-._
-}
-
-function install_evergreen {
-    echo _.-~= Installing Evergreen
-    date
-    cd /home/opensrf/Evergreen
-    make install
-    echo Return Value = $?
-
-    cp /openils/conf/opensrf.xml.example      /openils/conf/opensrf.xml
-    cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml
-
-    # fetch and install Dojo
-    cd /tmp;
-    wget -N "http://download.dojotoolkit.org/release-$DOJO_VERSION/dojo-release-$DOJO_VERSION.tar.gz" \
-    || wget -N "http://evergreen-ils.org/~phasefx/download.dojotoolkit.org/dojo-release-$DOJO_VERSION.tar.gz"
-    tar -zxf dojo-release-$DOJO_VERSION.tar.gz;
-    cp -r dojo-release-$DOJO_VERSION/* /openils/var/web/js/dojo/;
-
-    # give it all to opensrf
-    chown -R opensrf:opensrf /openils
-
-    # copy srfsh config into place
-    cp /openils/conf/srfsh.xml.example /home/opensrf/.srfsh.xml;
-    chown opensrf:opensrf /home/opensrf/.srfsh.xml;
-    echo End of Installing Evergreen =~-._
-}
-
-function configure_database {
-    echo _.-~= configure database
-    date
-    if [ $YES ]; then
-        echo "Using password $PGPASSWORD for the $PGUSER database user."
-        echo -e "$PGPASSWORD\n$PGPASSWORD\n" | su - postgres sh -c "createuser -P -s $PGUSER;"
-    else
-        echo -e "\n\nPlease enter a password for the $PGUSER database user.\n  If you do not want to edit configs, use \"$PGPASSWORD\"\n"
-        su - postgres sh -c "createuser -P -s $PGUSER;"
-    fi;
-
-    # Apply the DB schema
-    cd /home/opensrf/Evergreen
-    perl Open-ILS/src/support-scripts/eg_db_config \
-        --create-database       \
-        --create-schema         \
-        --create-offline        \
-        --update-config $SAMPLEDATA \
-        --service all           \
-        --user $PGUSER          \
-        --password $PGPASSWORD  \
-        --hostname $PGHOST      \
-        --database $PGDATABASE  \
-        --admin-user $ADMIN_USER \
-        --admin-pass $ADMIN_PASS;
-    echo Return Value = $?
-
-    if [ $LIVETEST ]; then
-        PG_TAP_VER="0.97.0"
-        wget -N http://api.pgxn.org/dist/pgtap/$PG_TAP_VER/pgtap-$PG_TAP_VER.zip \
-        && unzip pgtap-$PG_TAP_VER.zip \
-        && cd pgtap-$PG_TAP_VER \
-        && make \
-        && make installcheck \
-        && make install
-        echo 'CREATE EXTENSION pgtap;' | su - postgres -c "psql evergreen"
-    fi;
-    echo configure database =~-._
-}
-
-function start_evergreen {
-    echo _.-~= Starting Evergreen
-    date
-    if [ $LIVETEST ]; then
-        rm /openils/var/log/*.log
-    fi
-
-    OSRF_COMMAND='
-    export LD_LIBRARY_PATH=/openils/lib:/usr/local/lib:/usr/local/lib/dbd:$LD_LIBRARY_PATH \
-    && export PATH=/openils/bin:$PATH \
-    && OSRF_HOSTNAME="dns_hack" /openils/bin/osrf_control --localhost --restart-all  && sleep 3 \
-    && /openils/bin/autogen.sh /openils/conf/opensrf_core.xml \
-    && echo Finis;
-    '
-    echo Starting services...
-    su - opensrf sh -c "$OSRF_COMMAND";
-    echo Return Value = $?
-
-    echo Restarting Apache
-    /etc/init.d/apache2 restart
-    echo Return Value = $?
-
-    echo End of Starting Evergreen =~-._
-}
-
 function test_evergreen_live {
     # TODO: Eventually move these tests into a Make target within Evergreen
     cd /home/test/Evergreen
@@ -1285,6 +1049,38 @@ function test_evergreen_live {
     date
 }
 
-my_init
+function docs_builder_prereqs {
+    echo _.-~= Installing prereqs for building the documentation formats
+    date
+    # Install tools used for building the docs
+    apt-get -yq install asciidoc source-highlight fop;
+    echo Return Value = $?
+
+    echo End of Installing prereqs for building the documentation formats =~-._
+}
 
+function build_the_docs {
+    echo _.-~= Building the AsciiDoc output formats
+    date
+    # build HTML
+    su - test sh -c 'cd /home/test/Evergreen/docs/ ; asciidoc root.adoc ; echo Return Value = $?'
+    # build PDF
+    su - test sh -c 'cd /home/test/Evergreen/docs/ ; a2x --fop --fop-opts="-q" root.adoc ; echo Return Value = $?'
+    # build EPUB
+    su - test sh -c 'cd /home/test/Evergreen/docs/ ; a2x --no-xmllint --format epub root.adoc ; echo Return Value = $?'
+
+    echo End of Building the AsciiDoc output formats =~-._
+}
+
+function get_opensrf_tip {
+    cd /home/test/OpenSRF/
+    echo 'Tip of OpenSRF:' `git log --format=oneline | head -1`
+}
+
+function get_eg_tip {
+    cd /home/test/Evergreen/
+    echo 'Tip of Evergreen:' `git log --format=oneline | head -1`
+}
+
+my_init