Further updates to install scripts for EG 2.4.0 and OpenSRF 2.2.0
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Fri, 14 Jun 2013 19:58:27 +0000 (12:58 -0700)
committerJeff Davis <jdavis@sitka.bclibraries.ca>
Thu, 20 Jun 2013 20:05:09 +0000 (13:05 -0700)
deployment/install-eg.sh
deployment/install-osrf.sh

index a2fa611..ff93759 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 # IMPORTANT! This script assumes you have already installed OpenSRF.
 
-HOSTNAME="nonprod"
+HOSTNAME="nonprod-24"
 DEFAULT_USER="sitkastaff"
 HOMEDIR="/home/${DEFAULT_USER}"
 BUILDDIR="${HOMEDIR}/evergreen"
@@ -16,39 +16,43 @@ OPACSKIN="${DEPLOYDIR}/opacskin"
 OILSPOLICY="${DEPLOYDIR}/oilspolicy"
 TPACS="${DEPLOYDIR}/deploykit"
 
+suwrap() {
+  su -s /bin/bash -l -c "source ~/.bashrc ; $1" $2
+}
+
 # as DEFAULT_USER
 
 # grab Sitka config files
 if [ ! -d "${SITKACONF}" ]
 then
   # this will fail unless DEFAULT_USER has read access to the repo
-  su -l -c "cd ${HOMEDIR} && git clone git+ssh://git@git.sitka.bclibraries.ca/sitka-infra/sysadmin" ${DEFAULT_USER}
+  suwrap "cd ${HOMEDIR} && git clone git+ssh://git@git.sitka.bclibraries.ca/sitka-infra/sysadmin" ${DEFAULT_USER}
 fi
-su -l -c "cd ${SITKACONF} && git pull" ${DEFAULT_USER}
+suwrap "cd ${SITKACONF} && git pull" ${DEFAULT_USER}
 
 # checkout EG source
 if [ ! -d "${BUILDDIR}" ]
 then
-  su -l -c "cd ${HOMEDIR} && git clone git://git.sitka.bclibraries.ca/sitka/evergreen evergreen" ${DEFAULT_USER}
+  suwrap "cd ${HOMEDIR} && git clone git://git.sitka.bclibraries.ca/sitka/evergreen evergreen" ${DEFAULT_USER}
 fi
-su -l -c "cd ${BUILDDIR} && git checkout ${BRANCH}" ${DEFAULT_USER}
+suwrap "cd ${BUILDDIR} && git checkout ${BRANCH}" ${DEFAULT_USER}
  
 # as root
 cd ${BUILDDIR} && make -f Open-ILS/src/extras/Makefile.install ubuntu-precise
 # by default, CPAN needs some manual input at this point; you can just accept all defaults
  
 # as DEFAULT_USER
-su -l -c "cd ${BUILDDIR} && autoreconf -i" ${DEFAULT_USER}
-su -s /bin/bash -l -c "cd ${BUILDDIR} && ./configure -C --prefix=${INSTALLDIR} --sysconfdir=${INSTALLDIR}/conf --with-opensrf-headers=${INSTALLDIR}/include/ --with-opensrf-libs=${INSTALLDIR}/lib/ --with-dbi=/usr/lib/dbd/" ${DEFAULT_USER}
-su -l -c "cd ${BUILDDIR} && make" ${DEFAULT_USER}
-su -l -c "cd ${BUILDDIR}/build/i18n && make install_all_locales" ${DEFAULT_USER}
+suwrap "cd ${BUILDDIR} && autoreconf -i" ${DEFAULT_USER}
+suwrap "cd ${BUILDDIR} && ./configure -C --prefix=${INSTALLDIR} --sysconfdir=${INSTALLDIR}/conf --with-opensrf-headers=${INSTALLDIR}/include/ --with-opensrf-libs=${INSTALLDIR}/lib/ --with-dbi=/usr/lib/dbd/" ${DEFAULT_USER}
+suwrap "cd ${BUILDDIR} && make" ${DEFAULT_USER}
+suwrap "cd ${BUILDDIR}/build/i18n && make install_all_locales" ${DEFAULT_USER}
  
 # as root
 cd ${BUILDDIR} && make STAFF_CLIENT_STAMP_ID=${STAMP_ID} STAFF_CLIENT_VERSION=${VERSION} install
 chown -R opensrf:opensrf ${INSTALLDIR}
  
 # Apache stuff (as root):
-APACHEFILES="/etc/apache2/eg_vhost.conf /etc/apache2/startup.pl /etc/apache2/sites-available/eg.conf /etc/apache2/envvars"
+APACHEFILES="/etc/apache2/eg_vhost.conf /etc/apache2/eg_startup /etc/apache2/sites-available/eg.conf"
 for APACHEFILE in ${APACHEFILES}
 do
   cp ${SITKACONF}/files/${APACHEFILE}/${HOSTNAME} ${APACHEFILE}
@@ -67,6 +71,7 @@ cd /etc/apache2/ssl && openssl req -new -x509 -days 365 -nodes -out server.crt -
 OSRFCONFFILES="${INSTALLDIR}/conf/opensrf.xml ${INSTALLDIR}/conf/opensrf_core.xml"
 for OSRFCONFFILE in ${OSRFCONFFILES}
 do
+  rm ${OSRFCONFFILE}
   cp ${SITKACONF}/files/${OSRFCONFFILE}/${HOSTNAME} ${OSRFCONFFILE}
 done
 cp ${SITKACONF}/files/home/opensrf/.srfsh.xml/${HOSTNAME} ${HOMEDIR}/.srfsh.xml
index e59ecd6..158b939 100755 (executable)
@@ -24,7 +24,9 @@ then
   su -l -c "cd ${HOMEDIR} && git clone git+ssh://git@git.sitka.bclibraries.ca/sitka-infra/sysadmin" ${DEFAULT_USER}
 fi
 su -l -c "cd ${HOMEDIR}/sysadmin && git pull" ${DEFAULT_USER}
-su -l -c "cd ${HOMEDIR} && wget http://open-ils.org/downloads/${OSRF}.tar.gz && tar xzf ${OSRF}.tar.gz" ${DEFAULT_USER}
+if [ ! -d "${HOMEDIR}/${OSRF}" ] ; then
+  su -l -c "cd ${HOMEDIR} && wget http://open-ils.org/downloads/${OSRF}.tar.gz && tar xzf ${OSRF}.tar.gz" ${DEFAULT_USER}
+fi
  
 # as root
 echo "Installing OpenSRF prerequisites for Ubuntu..."