install-eg.sh: install Sitka's version of 2.6.1 from git
[sitka/sitka-tools.git] / deployment / install-eg.sh
index 95a459c..03b9fe0 100755 (executable)
@@ -1,15 +1,15 @@
 #!/bin/bash
 # IMPORTANT! This script assumes you have already installed OpenSRF.
 
-HOSTNAME="nonprod-24"
+HOSTNAME="nonprod-26"
 DEFAULT_USER="sitkastaff"
 HOMEDIR="/home/${DEFAULT_USER}"
 BUILDDIR="${HOMEDIR}/evergreen"
 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 rel_2_4_0_sitka_0"
+BRANCH="upgrade/eg26/beta1-tpac"
+VERSION="2.6.0.sitka.0"
+STAMP_ID="2_6_0_sitka_0"
+ALT_STAMP_IDS="rel_2_6_0_sitka_0"
 SITKACONF="${HOMEDIR}/sysadmin"
 
 suwrap() {
@@ -31,7 +31,7 @@ if [ ! -d "${BUILDDIR}" ]
 then
   suwrap "cd ${HOMEDIR} && git clone git://git.sitka.bclibraries.ca/sitka/evergreen evergreen" ${DEFAULT_USER}
 fi
-suwrap "cd ${BUILDDIR} && git checkout ${BRANCH}" ${DEFAULT_USER}
+suwrap "cd ${BUILDDIR} && git fetch origin && git checkout ${BRANCH} && git pull" ${DEFAULT_USER}
  
 # as root
 cd ${BUILDDIR} && make -f Open-ILS/src/extras/Makefile.install ubuntu-precise
@@ -51,15 +51,19 @@ chown -R opensrf:opensrf ${INSTALLDIR}
 APACHEFILES="/etc/apache2/eg_vhost.conf /etc/apache2/eg_startup /etc/apache2/sites-available/eg.conf"
 for APACHEFILE in ${APACHEFILES}
 do
+  mv ${APACHEFILE} ${APACHEFILE}.bak
   cp ${SITKACONF}/files/${APACHEFILE}/${HOSTNAME} ${APACHEFILE}
 done
 a2dissite default
 a2ensite eg.conf
-mkdir /etc/apache2/ssl
-cd /etc/apache2/ssl && openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key
+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
 
 # set up log rotation
-if [ ! -d "/etc/logrotate.d/evergreen" ]
+if [ ! -f "/etc/logrotate.d/evergreen" ]
 then
   cp ${SITKACONF}/files/etc/logrotate.d/evergreen/${HOSTNAME} /etc/logrotate.d/evergreen
 fi
@@ -69,19 +73,19 @@ fi
 OSRFCONFFILES="${INSTALLDIR}/conf/opensrf.xml ${INSTALLDIR}/conf/opensrf_core.xml"
 for OSRFCONFFILE in ${OSRFCONFFILES}
 do
-  rm ${OSRFCONFFILE}
+  mv ${OSRFCONFFILE} ${OSRFCONFFILE}.bak
   cp ${SITKACONF}/files/${OSRFCONFFILE}/${HOSTNAME} ${OSRFCONFFILE}
 done
-if [ ! -d "${HOMEDIR}/.srfsh.xml" ]
+if [ ! -f "${HOMEDIR}/.srfsh.xml" ]
 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
+if [ ! -f "/home/opensrf/dojo-release-1.3.3.tar.gz" ]
+then
+  cd /home/opensrf && wget http://download.dojotoolkit.org/release-1.3.3/dojo-release-1.3.3.tar.gz
+fi
 tar -C ${INSTALLDIR}/var/web/js -xzf /home/opensrf/dojo-release-1.3.3.tar.gz
 cp -r ${INSTALLDIR}/var/web/js/dojo-release-1.3.3/* ${INSTALLDIR}/var/web/js/dojo/.
  
@@ -145,3 +149,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