updated install scripts for production 2.4 environment
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Wed, 24 Jul 2013 21:21:19 +0000 (14:21 -0700)
committerJeff Davis <jdavis@sitka.bclibraries.ca>
Wed, 24 Jul 2013 21:21:19 +0000 (14:21 -0700)
deployment/install-drone.sh [new file with mode: 0755]
deployment/install-eg.sh
deployment/install-osrf.sh

diff --git a/deployment/install-drone.sh b/deployment/install-drone.sh
new file mode 100755 (executable)
index 0000000..72cfb1f
--- /dev/null
@@ -0,0 +1,74 @@
+#!/bin/bash
+# IMPORTANT! This script assumes you have already installed OpenSRF.
+
+HOSTNAME="prod-24"
+DEFAULT_USER="sitkastaff"
+HOMEDIR="/home/${DEFAULT_USER}"
+BUILDDIR="${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"
+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
+
+# 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/
+echo "ldconfig stuff..."
+echo "${INSTALLDIR}/lib" > /etc/ld.so.conf.d/opensrf.conf
+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
+# 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
+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
+
index 7b443cf..39ea0cc 100755 (executable)
@@ -6,15 +6,11 @@ DEFAULT_USER="sitkastaff"
 HOMEDIR="/home/${DEFAULT_USER}"
 BUILDDIR="${HOMEDIR}/evergreen"
 INSTALLDIR="/srv/openils"
-BRANCH="user/jeffdavis/sitka-24-beta1"
+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"
 SITKACONF="${HOMEDIR}/sysadmin"
-DEPLOYDIR="/home/opensrf/deploy"
-OPACSKIN="${DEPLOYDIR}/opacskin"
-OILSPOLICY="${DEPLOYDIR}/oilspolicy"
-TPACS="${DEPLOYDIR}/deploykit"
 
 suwrap() {
   su -s /bin/bash -l -c "source ~/.bashrc ; $1" $2
@@ -52,13 +48,13 @@ cd ${BUILDDIR} && make STAFF_CLIENT_STAMP_ID=${STAMP_ID} STAFF_CLIENT_VERSION=${
 chown -R opensrf:opensrf ${INSTALLDIR}
  
 # Apache stuff (as root):
-APACHEFILES="/etc/apache2/eg_vhost.conf /etc/apache2/eg_startup /etc/apache2/sites-available/000-evergreen.conf"
+APACHEFILES="/etc/apache2/eg_vhost.conf /etc/apache2/eg_startup /etc/apache2/sites-available/eg.conf"
 for APACHEFILE in ${APACHEFILES}
 do
   cp ${SITKACONF}/files/${APACHEFILE}/${HOSTNAME} ${APACHEFILE}
 done
 a2dissite default
-a2ensite 000-evergreen.conf
+a2ensite eg.conf
 mkdir /etc/apache2/ssl
 cd /etc/apache2/ssl && openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key
 
@@ -75,64 +71,25 @@ do
   rm ${OSRFCONFFILE}
   cp ${SITKACONF}/files/${OSRFCONFFILE}/${HOSTNAME} ${OSRFCONFFILE}
 done
-cp ${SITKACONF}/files/home/opensrf/.srfsh.xml/${HOSTNAME} ${HOMEDIR}/.srfsh.xml
+if [ ! -d "${HOMEDIR}/.srfsh.xml" ]
+then
+  cp ${SITKACONF}/files/home/opensrf/.srfsh.xml/${HOSTNAME} ${HOMEDIR}/.srfsh.xml
+fi 
+
 # 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
 cp -r ${INSTALLDIR}/var/web/js/dojo-release-1.3.3/* ${INSTALLDIR}/var/web/js/dojo/.
  
 # 2. set up staff client
+cd ${INSTALLDIR}/var/web/xul && rm server && rm current
 cd ${INSTALLDIR}/var/web/xul && ln -s ${STAMP_ID} current && ln -s current/server server
 for ALT_STAMP_ID in ${ALT_STAMP_IDS}
 do
   cd ${INSTALLDIR}/var/web/xul && ln -s current ${ALT_STAMP_ID}
 done
  
-# 3. install circ scripts and opac skins
-
-# (a) setup deploy directory
-if [ ! -d "${DEPLOYDIR}" ]
-then
-  mkdir ${DEPLOYDIR}
-fi
-
-# (b) bclibraries skin
-if [ ! -d "${OPACSKIN}" ]
-then
-  cd ${DEPLOYDIR} && git clone git://git.sitka.bclibraries.ca/sitka/opacskin.git
-fi
-cd ${OPACSKIN} && git checkout -b bclibraries && \
-  cd ${INSTALLDIR}/var/web/opac/skin && mv default orig-default && \
-  rsync -a --exclude=.git ${OPACSKIN} ${INSTALLDIR}/var/web/opac/skin/bclibraries && \
-  ln -s ${INSTALLDIR}/var/web/opac/skin/bclibraries ${INSTALLDIR}/var/web/opac/skin/default
-
-# (c) TPAC stuff
-apt-get install rake erubis ruby-git
-if [ ! -d "${TPACS}" ]; then
-  cd ${DEPLOYDIR} && git clone git://git.sitka.bclibraries.ca/sitka/deploykit.git
-fi
-cd ${TPACS} && git pull
-cd ${TPACS}/deploykit && mv config.yml.sample config.yml
-if [ ! -d "/etc/apache2/includes" ]; then
-  mkdir /etc/apache2/includes
-fi
-if [ ! -d "/srv/openils/var/skins" ]; then
-  mkdir /srv/openils/var/skins
-fi
-# TODO: use rake to build AND deploy properly!
-#cd ${TPACS}/deploykit && rake tpac:all && \
-#  for TPACSKIN in `ls -1 ${TPACS}/deploykit/build`; do mkdir -p /srv/openils/var/skins/${TPACSKIN}/opac && \
-#    cp -r build/${TPACSKIN}/templates/opac/* /srv/openils/var/skins/${TPACSKIN}/opac/ && \
-#    cp ${TPACS}/build/${TPACSKIN}/apache2/${TPACSKIN}.conf /etc/apache2/sites-available/ && \
-#    cp ${TPACS}/build/${TPACSKIN}/apache2/${TPACSKIN}.conf-include /etc/apache2/includes/ ; done
-
-# (d) circ scripts
-if [ ! -d "${OILSPOLICY}" ]
-then
-  cd ${DEPLOYDIR} && git clone git://git.sitka.bclibraries.ca/sitka/oilspolicy.git
-fi
-cd ${OILSPOLICY} && git pull && rsync -a --exclude=.git ${OILSPOLICY} ${INSTALLDIR}/var
+# 3. install circ scripts and opac skins - DEPRECATED
  
 # 4. avoid 404s
 touch ${INSTALLDIR}/var/web/css/skin/default/register_custom.css
index 158b939..94b4444 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 OSRF="opensrf-2.2.0"
 INSTALLDIR="/srv/openils"
-HOSTNAME="nonprod"
+HOSTNAME="nonprod-24"
 DEFAULT_USER="sitkastaff"
 HOMEDIR="/home/${DEFAULT_USER}"
 SITKACONF="${HOMEDIR}/sysadmin"