Deploy latest EG branch (upgrade/eg26/rc1-tpac)
[sitka/sitka-tools.git] / deployment / install-drone.sh
CommitLineData
9d46f12d
JD
1#!/bin/bash
2# IMPORTANT! This script assumes you have already installed OpenSRF.
3
4HOSTNAME="prod-24"
5DEFAULT_USER="sitkastaff"
6HOMEDIR="/home/${DEFAULT_USER}"
7BUILDDIR="${HOMEDIR}/evergreen"
8INSTALLDIR="/srv/openils"
9OSRF="opensrf-2.2.0"
10BRANCH="production/sitka_2_4"
11VERSION="2.4.0.sitka.0"
12STAMP_ID="2_4_0_sitka_0"
13SITKACONF="${HOMEDIR}/sysadmin"
14OSRFDESTDIR="/tmp/${OSRF}-install"
15EGDESTDIR="/tmp/${STAMP_ID}-install"
16
17suwrap() {
18 su -s /bin/bash -l -c "source ~/.bashrc ; $1" $2
19}
20
21# OPENSRF
22# ----------------------------------------------------------------------
23
24# as root
25apt-get install git-core build-essential translate-toolkit python-polib bsdmainutils
26echo "Installing OpenSRF prerequisites for Ubuntu..."
27cd ${HOMEDIR}/${OSRF} && make -f src/extras/Makefile.install ubuntu-precise
28
29# as DEFAULT_USER
30#echo "Configuring and building OpenSRF..."
31#su -l -c "cd ${HOMEDIR}/${OSRF} && autoreconf -i" ${DEFAULT_USER}
32#su -l -c "cd ${HOMEDIR}/${OSRF} && ./configure --prefix=${INSTALLDIR} --sysconfdir=${INSTALLDIR}/conf" ${DEFAULT_USER}
33#su -l -c "cd ${HOMEDIR}/${OSRF} && make" ${DEFAULT_USER}
34
35# as root
36echo "Installing OpenSRF..."
37cd ${HOMEDIR}/${OSRF} && make install DESTDIR=${OSRFDESTDIR}
38rsync -av ${DESTDIR}/usr/ /usr/
39echo "ldconfig stuff..."
40echo "${INSTALLDIR}/lib" > /etc/ld.so.conf.d/opensrf.conf
41ldconfig
42
43# EVERGREEN
44# ----------------------------------------------------------------------
45
46# as DEFAULT_USER
47
48# checkout EG source
49#if [ -d "${BUILDDIR}" ]
50#then
51# suwrap "mv ${BUILDDIR} ${BUILDDIR}.bak.`date +%Y%m%d%H%M`" ${DEFAULT_USER}
52#fi
53#suwrap "cd ${HOMEDIR} && git clone git://git.sitka.bclibraries.ca/sitka/evergreen evergreen" ${DEFAULT_USER}
54#suwrap "cd ${BUILDDIR} && git checkout ${BRANCH}" ${DEFAULT_USER}
55
56# as root
57cd ${BUILDDIR} && make -f Open-ILS/src/extras/Makefile.install ubuntu-precise
58# by default, CPAN needs some manual input at this point; you can just accept all defaults
59
60# as DEFAULT_USER
61#suwrap "cd ${BUILDDIR} && autoreconf -i" ${DEFAULT_USER}
62#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}
63#suwrap "cd ${BUILDDIR} && make" ${DEFAULT_USER}
64#suwrap "cd ${BUILDDIR}/build/i18n && make install_all_locales" ${DEFAULT_USER}
65
66# as root
67cd ${BUILDDIR} && make DESTDIR=${EGDESTDIR} STAFF_CLIENT_STAMP_ID=${STAMP_ID} STAFF_CLIENT_VERSION=${VERSION} install
68rsync -av ${DESTDIR}/usr/ /usr/
69
70# 9. make sure opensrf owns all the stuff we just did
71chown -R opensrf:opensrf ${INSTALLDIR} 2>/dev/null
72chown -R opensrf:opensrf /home/opensrf
73chown -R opensrf:opensrf /var/lock/apache2
74