Check that deployed EG code matches the code in git.
[sitka/sitka-tools.git] / deployment / install-eg.sh
index 39ea0cc..e26ba09 100755 (executable)
@@ -9,7 +9,7 @@ INSTALLDIR="/srv/openils"
 BRANCH="production/sitka_2_4"
 VERSION="2.4.0.sitka.0"
 STAMP_ID="2_4_0_sitka_0"
-ALT_STAMP_IDS="rel_2_4_0_sitka_0 2_4_0_sitka_0 rel_2_4_0_sitka_0"
+ALT_STAMP_IDS="rel_2_4_0_sitka_0 rel_2_4_0_sitka_0"
 SITKACONF="${HOMEDIR}/sysadmin"
 
 suwrap() {
@@ -41,7 +41,7 @@ cd ${BUILDDIR} && make -f Open-ILS/src/extras/Makefile.install ubuntu-precise
 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}
+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
@@ -58,10 +58,11 @@ a2ensite eg.conf
 mkdir /etc/apache2/ssl
 cd /etc/apache2/ssl && openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key
 
-# setup offline circ
-cd ${BUILDDIR} && perl Open-ILS/src/support-scripts/eg_db_config --create-offline
-# TODO: set up log rotation
+# set up log rotation
+if [ ! -d "/etc/logrotate.d/evergreen" ]
+then
+  cp ${SITKACONF}/files/etc/logrotate.d/evergreen/${HOSTNAME} /etc/logrotate.d/evergreen
+fi
  
 # 0. osrf conf stuff 
 # FIXME: ensure osrf conf files point at a real, distinct db!
@@ -76,6 +77,9 @@ then
   cp ${SITKACONF}/files/home/opensrf/.srfsh.xml/${HOSTNAME} ${HOMEDIR}/.srfsh.xml
 fi 
 
+# setup offline circ
+cd ${BUILDDIR} && perl Open-ILS/src/support-scripts/eg_db_config --create-offline
 # 1. install dojo
 cd /home/opensrf && wget http://download.dojotoolkit.org/release-1.3.3/dojo-release-1.3.3.tar.gz
 tar -C ${INSTALLDIR}/var/web/js -xzf /home/opensrf/dojo-release-1.3.3.tar.gz
@@ -113,7 +117,7 @@ cd ${INSTALLDIR}/var/web/opac/locale && cp -fdr en-US en-US-bak && cp -fdr en-CA
 # 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'
+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
@@ -141,3 +145,6 @@ chown -R opensrf:opensrf /var/lock/apache2
 
 # 10. staff client stuff
 apt-get install nsis unzip
+
+# 11. integrity checker prereqs
+apt-get install libconfig-simple-perl libgit-repository-perl libdate-manip-perl