install-eg.sh: tweaks for Sitka-customized EG2.8 install
[sitka/sitka-tools.git] / deployment / install-eg.sh
index 211349e..545d622 100755 (executable)
@@ -4,12 +4,13 @@
 HOSTNAME="nonprod-28"
 DEFAULT_USER="sitkastaff"
 HOMEDIR="/home/${DEFAULT_USER}"
-EGRELEASE="Evergreen-ILS-2.8.beta"
-BUILDDIR="${HOMEDIR}/${EGRELEASE}"
+#EGRELEASE="Evergreen-ILS-2.8.beta"
+#BUILDDIR="${HOMEDIR}/${EGRELEASE}"
+BUILDDIR="${HOMEDIR}/evergreen"
 INSTALLDIR="/srv/openils"
-#BRANCH="upgrade/eg28/beta-tpac"
-STAMP_ID="rel_2_8_beta"
-ALT_STAMP_IDS="2_8_beta"
+BRANCH="upgrade/eg28/phase2-tpac"
+STAMP_ID="rel_2_8_0"
+ALT_STAMP_IDS="2_8_0 rel_2_8_beta 2_8_beta"
 SITKACONF="${HOMEDIR}/sysadmin"
 
 suwrap() {
@@ -27,15 +28,15 @@ fi
 suwrap "cd ${SITKACONF} && git pull" ${DEFAULT_USER}
 
 # checkout EG source
-#if [ ! -d "${BUILDDIR}" ]
-#then
-#  suwrap "cd ${HOMEDIR} && git clone git://git.sitka.bclibraries.ca/sitka/evergreen evergreen" ${DEFAULT_USER}
-#fi
-#suwrap "cd ${BUILDDIR} && git fetch origin && git checkout ${BRANCH} && git pull" ${DEFAULT_USER}
+if [ ! -d "${BUILDDIR}" ]
+then
+  suwrap "cd ${HOMEDIR} && git clone git://git.sitka.bclibraries.ca/sitka/evergreen evergreen" ${DEFAULT_USER}
+fi
+suwrap "cd ${BUILDDIR} && git fetch origin && git checkout ${BRANCH} && git pull" ${DEFAULT_USER}
 
 # download and unpack EG release
-rm -rf ${BUILDDIR}
-suwrap "cd ${HOMEDIR} && wget http://open-ils.org/downloads/${EGRELEASE}.tar.gz && tar xzf ${EGRELEASE}.tar.gz" ${DEFAULT_USER}
+#rm -rf ${BUILDDIR}
+#suwrap "cd ${HOMEDIR} && wget http://open-ils.org/downloads/${EGRELEASE}.tar.gz && tar xzf ${EGRELEASE}.tar.gz" ${DEFAULT_USER}
  
 # as root
 cd ${BUILDDIR} && make -f Open-ILS/src/extras/Makefile.install ubuntu-trusty
@@ -43,14 +44,14 @@ cd ${BUILDDIR} && make -f Open-ILS/src/extras/Makefile.install ubuntu-trusty-dev
 # 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} # not required for release versions
+suwrap "cd ${BUILDDIR} && autoreconf -i" ${DEFAULT_USER} # not required for release versions
 suwrap "cd ${BUILDDIR} && ./configure -C --prefix=${INSTALLDIR} --sysconfdir=${INSTALLDIR}/conf --with-opensrf-headers=${INSTALLDIR}/include/ --with-opensrf-libs=${INSTALLDIR}/lib/" ${DEFAULT_USER}
 suwrap "cd ${BUILDDIR} && make" ${DEFAULT_USER}
 suwrap "cd ${BUILDDIR}/build/i18n && make LOCALE=fr-CA install && make LOCALE=en-CA install" ${DEFAULT_USER}
  
 # as root
 cd ${BUILDDIR} && make STAFF_CLIENT_STAMP_ID=${STAMP_ID} install
-#mv ${INSTALLDIR}/var/web/reports/fm_IDL.xml ${INSTALLDIR}/var/web/reports/fm_IDL.xml.orig && cp ${INSTALLDIR}/conf/fm_IDL.xml ${INSTALLDIR}/var/web/reports/
+mv ${INSTALLDIR}/var/web/reports/fm_IDL.xml ${INSTALLDIR}/var/web/reports/fm_IDL.xml.orig && cp ${INSTALLDIR}/conf/fm_IDL.xml ${INSTALLDIR}/var/web/reports/
 chown -R opensrf:opensrf ${INSTALLDIR}
  
 # Apache stuff (as root):
@@ -60,13 +61,13 @@ do
   mv ${APACHEFILE} ${APACHEFILE}.bak
   cp ${SITKACONF}/files/${APACHEFILE}/${HOSTNAME} ${APACHEFILE}
 done
-a2dissite 000-default
-a2ensite eg.conf
-if [ ! -d "/etc/apache2/ssl" ]
-then
-  mkdir /etc/apache2/ssl
-  cd /etc/apache2/ssl && openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key
-fi
+#a2dissite 000-default
+#a2ensite eg.conf
+#if [ ! -d "/etc/apache2/ssl" ]
+#then
+#  mkdir /etc/apache2/ssl
+#  cd /etc/apache2/ssl && openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key
+#fi
 # ensure opensrf can run Apache
 chown -R opensrf:opensrf /var/lock/apache2
 
@@ -128,9 +129,9 @@ done
  
 # 6. deletepatron
 # ensure apache conf contains deletepatron config (location should be ${INSTALLDIR}/var/web/deletepatron)
-cd ${INSTALLDIR}/var/web && git clone https://github.com/twirlip/deletepatron.git
-cd ${INSTALLDIR}/var/web/deletepatron && git checkout eg22 && find . -name "*.pm" | xargs sed -i -e 's|/openils|/srv/openils|g'
-apt-get install libcgi-session-perl libhtml-template-perl
+#cd ${INSTALLDIR}/var/web && git clone https://github.com/twirlip/deletepatron.git
+#cd ${INSTALLDIR}/var/web/deletepatron && git checkout eg22 && find . -name "*.pm" | xargs sed -i -e 's|/openils|/srv/openils|g'
+apt-get install -y libcgi-session-perl libhtml-template-perl
 
 # 7. support scripts - XXX deprecated?
 #cp ${BUILDDIR}/Open-ILS/src/support-scripts/generate_circ_notices.pl ${INSTALLDIR}/bin
@@ -155,10 +156,10 @@ chown -R opensrf:opensrf ${INSTALLDIR}
 chown -R opensrf:opensrf /home/opensrf
 
 # 10. staff client stuff
-apt-get install nsis unzip
+apt-get install -y nsis unzip
 
 # 11. integrity checker prereqs
-apt-get install libconfig-simple-perl libgit-repository-perl libdate-manip-perl
+apt-get install -y libconfig-simple-perl libgit-repository-perl libdate-manip-perl
 
 # 12. paper overdue prereqs
-apt-get install python-reportlab python-reportlab-accel
+apt-get install -y python-reportlab python-reportlab-accel