install-eg.sh: update for Evergreen 2.8 beta
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Thu, 5 Mar 2015 23:30:35 +0000 (15:30 -0800)
committerJeff Davis <jdavis@sitka.bclibraries.ca>
Thu, 5 Mar 2015 23:30:45 +0000 (15:30 -0800)
deployment/install-eg.sh

index d572602..3523293 100755 (executable)
@@ -1,15 +1,15 @@
 #!/bin/bash
 # IMPORTANT! This script assumes you have already installed OpenSRF.
 
 #!/bin/bash
 # IMPORTANT! This script assumes you have already installed OpenSRF.
 
-HOSTNAME="nonprod"
+HOSTNAME="nonprod-28"
 DEFAULT_USER="sitkastaff"
 HOMEDIR="/home/${DEFAULT_USER}"
 DEFAULT_USER="sitkastaff"
 HOMEDIR="/home/${DEFAULT_USER}"
-BUILDDIR="${HOMEDIR}/evergreen"
+EGRELEASE="Evergreen-ILS-2.8.beta"
+BUILDDIR="${HOMEDIR}/${EGRELEASE}"
 INSTALLDIR="/srv/openils"
 INSTALLDIR="/srv/openils"
-BRANCH="production/sitka_2_6_tpac"
-VERSION="2.6.0.sitka.0"
-STAMP_ID="2_6_0_sitka_0"
-ALT_STAMP_IDS="rel_2_6_0_sitka_0"
+#BRANCH="upgrade/eg28/beta-tpac"
+STAMP_ID="rel_2_8_beta"
+ALT_STAMP_IDS="2_8_beta"
 SITKACONF="${HOMEDIR}/sysadmin"
 
 suwrap() {
 SITKACONF="${HOMEDIR}/sysadmin"
 
 suwrap() {
@@ -27,25 +27,30 @@ fi
 suwrap "cd ${SITKACONF} && git pull" ${DEFAULT_USER}
 
 # checkout EG source
 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}
  
 # as root
  
 # as root
-cd ${BUILDDIR} && make -f Open-ILS/src/extras/Makefile.install ubuntu-precise
+cd ${BUILDDIR} && make -f Open-ILS/src/extras/Makefile.install ubuntu-trusty
+cd ${BUILDDIR} && make -f Open-ILS/src/extras/Makefile.install ubuntu-trusty-developer # required for web client
 # by default, CPAN needs some manual input at this point; you can just accept all defaults
  
 # as DEFAULT_USER
 # 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} && 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/ --with-dbi=/usr/lib/dbd/" ${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
 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 LOCALE=fr-CA install && make LOCALE=en-CA install" ${DEFAULT_USER}
  
 # as root
-cd ${BUILDDIR} && make STAFF_CLIENT_STAMP_ID=${STAMP_ID} STAFF_CLIENT_VERSION=${VERSION} 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/
+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/
 chown -R opensrf:opensrf ${INSTALLDIR}
  
 # Apache stuff (as root):
 chown -R opensrf:opensrf ${INSTALLDIR}
  
 # Apache stuff (as root):
@@ -62,6 +67,8 @@ then
   mkdir /etc/apache2/ssl
   cd /etc/apache2/ssl && openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key
 fi
   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
 
 # set up log rotation
 if [ ! -f "/etc/logrotate.d/evergreen" ]
 
 # set up log rotation
 if [ ! -f "/etc/logrotate.d/evergreen" ]
@@ -99,25 +106,25 @@ do
 done
  
 # 3. install circ scripts and opac skins - DEPRECATED
 done
  
 # 3. install circ scripts and opac skins - DEPRECATED
-# 4. avoid 404s
-touch ${INSTALLDIR}/var/web/css/skin/default/register_custom.css
-touch ${INSTALLDIR}/var/web/xul/server/locale/en-CA/patron_custom.properties
-touch ${INSTALLDIR}/var/web/xul/server/locale/en-CA/common_custom.properties
-touch ${INSTALLDIR}/var/web/xul/server/locale/en-CA/offline_custom.properties
-touch ${INSTALLDIR}/var/web/xul/server/locale/en-CA/auth_custom.properties
-touch ${INSTALLDIR}/var/web/xul/server/locale/en-CA/cat_custom.properties
-touch ${INSTALLDIR}/var/web/xul/server/locale/en-CA/circ_custom.properties
-touch ${INSTALLDIR}/var/web/xul/server/locale/en-US/patron_custom.properties
-touch ${INSTALLDIR}/var/web/xul/server/locale/en-US/common_custom.properties
-touch ${INSTALLDIR}/var/web/xul/server/locale/en-US/offline_custom.properties
-touch ${INSTALLDIR}/var/web/xul/server/locale/en-US/auth_custom.properties
-touch ${INSTALLDIR}/var/web/xul/server/locale/en-US/cat_custom.properties
-touch ${INSTALLDIR}/var/web/xul/server/locale/en-US/circ_custom.properties
-touch ${INSTALLDIR}/var/web/xul/server/skin/custom.js
-
-# 5. locale hack
-cd ${INSTALLDIR}/var/web/opac/locale && cp -fdr en-US en-US-bak && cp -fdr en-CA en-US
+
+# 4. avoid 404s - XXX deprecated?
+#touch ${INSTALLDIR}/var/web/css/skin/default/register_custom.css
+#touch ${INSTALLDIR}/var/web/xul/server/locale/en-CA/patron_custom.properties
+#touch ${INSTALLDIR}/var/web/xul/server/locale/en-CA/common_custom.properties
+#touch ${INSTALLDIR}/var/web/xul/server/locale/en-CA/offline_custom.properties
+#touch ${INSTALLDIR}/var/web/xul/server/locale/en-CA/auth_custom.properties
+#touch ${INSTALLDIR}/var/web/xul/server/locale/en-CA/cat_custom.properties
+#touch ${INSTALLDIR}/var/web/xul/server/locale/en-CA/circ_custom.properties
+#touch ${INSTALLDIR}/var/web/xul/server/locale/en-US/patron_custom.properties
+#touch ${INSTALLDIR}/var/web/xul/server/locale/en-US/common_custom.properties
+#touch ${INSTALLDIR}/var/web/xul/server/locale/en-US/offline_custom.properties
+#touch ${INSTALLDIR}/var/web/xul/server/locale/en-US/auth_custom.properties
+#touch ${INSTALLDIR}/var/web/xul/server/locale/en-US/cat_custom.properties
+#touch ${INSTALLDIR}/var/web/xul/server/locale/en-US/circ_custom.properties
+#touch ${INSTALLDIR}/var/web/xul/server/skin/custom.js
+
+# 5. locale hack - XXX deprecated?
+#cd ${INSTALLDIR}/var/web/opac/locale && cp -fdr en-US en-US-bak && cp -fdr en-CA en-US
  
 # 6. deletepatron
 # ensure apache conf contains deletepatron config (location should be ${INSTALLDIR}/var/web/deletepatron)
  
 # 6. deletepatron
 # ensure apache conf contains deletepatron config (location should be ${INSTALLDIR}/var/web/deletepatron)
@@ -125,9 +132,9 @@ cd ${INSTALLDIR}/var/web && git clone https://github.com/twirlip/deletepatron.gi
 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/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
 
-# 7. support scripts
-cp ${BUILDDIR}/Open-ILS/src/support-scripts/generate_circ_notices.pl ${INSTALLDIR}/bin
-cp ${BUILDDIR}/Open-ILS/src/support-scripts/oils_header.pl ${INSTALLDIR}/bin
+# 7. support scripts - XXX deprecated?
+#cp ${BUILDDIR}/Open-ILS/src/support-scripts/generate_circ_notices.pl ${INSTALLDIR}/bin
+#cp ${BUILDDIR}/Open-ILS/src/support-scripts/oils_header.pl ${INSTALLDIR}/bin
 
 # 8. setup start page
 if [ ! -d "${INSTALLDIR}/var/web/news" ]
 
 # 8. setup start page
 if [ ! -d "${INSTALLDIR}/var/web/news" ]
@@ -146,7 +153,6 @@ done
 # 9. make sure opensrf owns all the stuff we just did
 chown -R opensrf:opensrf ${INSTALLDIR}
 chown -R opensrf:opensrf /home/opensrf
 # 9. make sure opensrf owns all the stuff we just did
 chown -R opensrf:opensrf ${INSTALLDIR}
 chown -R opensrf:opensrf /home/opensrf
-chown -R opensrf:opensrf /var/lock/apache2
 
 # 10. staff client stuff
 apt-get install nsis unzip
 
 # 10. staff client stuff
 apt-get install nsis unzip