install-drone.sh: update for EG2.6
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Wed, 25 Jun 2014 23:27:13 +0000 (16:27 -0700)
committerJeff Davis <jdavis@sitka.bclibraries.ca>
Wed, 25 Jun 2014 23:27:13 +0000 (16:27 -0700)
deployment/install-drone.sh

index 72cfb1f..c7daa3a 100755 (executable)
@@ -1,41 +1,27 @@
 #!/bin/bash
-# IMPORTANT! This script assumes you have already installed OpenSRF.
-
-HOSTNAME="prod-24"
+# IMPORTANT! This script assumes you have already installed OpenSRF on the brick head.
 DEFAULT_USER="sitkastaff"
 HOMEDIR="/home/${DEFAULT_USER}"
-BUILDDIR="${HOMEDIR}/evergreen"
+OSRFBUILDDIR="${HOMEDIR}/opensrf"
+EGBUILDDIR="${HOMEDIR}/evergreen"
 INSTALLDIR="/srv/openils"
-OSRF="opensrf-2.2.0"
-BRANCH="production/sitka_2_4"
-VERSION="2.4.0.sitka.0"
-STAMP_ID="2_4_0_sitka_0"
-SITKACONF="${HOMEDIR}/sysadmin"
-OSRFDESTDIR="/tmp/${OSRF}-install"
+OSRFBRANCH="rel_2_3"
+VERSION="2.6.0.sitka.0"
+STAMP_ID="2_6_0_sitka_0"
+OSRFDESTDIR="/tmp/osrf-${OSRFBRANCH}-install"
 EGDESTDIR="/tmp/${STAMP_ID}-install"
 
-suwrap() {
-  su -s /bin/bash -l -c "source ~/.bashrc ; $1" $2
-}
-
 # OPENSRF
 # ---------------------------------------------------------------------- 
 
-# as root
 apt-get install git-core build-essential translate-toolkit python-polib bsdmainutils
 echo "Installing OpenSRF prerequisites for Ubuntu..."
-cd ${HOMEDIR}/${OSRF} && make -f src/extras/Makefile.install ubuntu-precise
+cd ${OSRFBUILDDIR} && make -f src/extras/Makefile.install ubuntu-precise
 
-# as DEFAULT_USER
-#echo "Configuring and building OpenSRF..."
-#su -l -c "cd ${HOMEDIR}/${OSRF} && autoreconf -i" ${DEFAULT_USER}
-#su -l -c "cd ${HOMEDIR}/${OSRF} && ./configure --prefix=${INSTALLDIR} --sysconfdir=${INSTALLDIR}/conf" ${DEFAULT_USER}
-#su -l -c "cd ${HOMEDIR}/${OSRF} && make" ${DEFAULT_USER}
-
-# as root
 echo "Installing OpenSRF..."
-cd ${HOMEDIR}/${OSRF} && make install DESTDIR=${OSRFDESTDIR}
-rsync -av ${DESTDIR}/usr/ /usr/
+cd ${OSRFBUILDDIR} && make install DESTDIR=${OSRFDESTDIR}
+rsync -av ${OSRFDESTDIR}/usr/ /usr/
 echo "ldconfig stuff..."
 echo "${INSTALLDIR}/lib" > /etc/ld.so.conf.d/opensrf.conf
 ldconfig
@@ -43,32 +29,9 @@ ldconfig
 # EVERGREEN
 # ---------------------------------------------------------------------- 
 
-# as DEFAULT_USER
-
-# checkout EG source
-#if [ -d "${BUILDDIR}" ]
-#then
-#  suwrap "mv ${BUILDDIR} ${BUILDDIR}.bak.`date +%Y%m%d%H%M`" ${DEFAULT_USER}
-#fi
-#suwrap "cd ${HOMEDIR} && git clone git://git.sitka.bclibraries.ca/sitka/evergreen evergreen" ${DEFAULT_USER}
-#suwrap "cd ${BUILDDIR} && git checkout ${BRANCH}" ${DEFAULT_USER}
-# as root
-cd ${BUILDDIR} && make -f Open-ILS/src/extras/Makefile.install ubuntu-precise
+cd ${EGBUILDDIR} && 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
-#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 DESTDIR=${EGDESTDIR} STAFF_CLIENT_STAMP_ID=${STAMP_ID} STAFF_CLIENT_VERSION=${VERSION} install
+cd ${EGBUILDDIR} && make DESTDIR=${EGDESTDIR} STAFF_CLIENT_STAMP_ID=${STAMP_ID} STAFF_CLIENT_VERSION=${VERSION} install
 rsync -av ${DESTDIR}/usr/ /usr/
  
-# 9. make sure opensrf owns all the stuff we just did
-chown -R opensrf:opensrf ${INSTALLDIR} 2>/dev/null
-chown -R opensrf:opensrf /home/opensrf
-chown -R opensrf:opensrf /var/lock/apache2
-