3 # (C) Copyright 2016 Georgia Public Library Service
4 # Chris Sharp <csharp@georgialibraries.org>
6 # This script assumes that you have already installed and configured
7 # OpenSRF and Evergreen using the git repository. It also assumes that
8 # the repositories exist in /home/opensrf and are named 'OpenSRF' and
12 STAMP_ID="evergreen-master"
16 OSRF_HOME_DIR="/home/opensrf"
22 echo "Usage: $0 [-o] [-e] [-c] [-t opensrf_git_branch] [-u evergreen_git_branch] [-h]"
24 echo "Without any parameters, this script upgrades both Evergreen"
25 echo "and OpenSRF to their current master versions"
26 echo "-o = Upgrade OpenSRF Only"
27 echo "-e = Upgrade Evergreen Only"
28 echo "-c = Additionally Build a Windows Staff Client"
29 echo "-t = Use the named OpenSRF git branch rather than master"
30 echo "-u = Use the named Evergreen git branch rather than master"
31 echo "-h = Show this message"
36 while getopts eocu:t:h OPTIONS
41 t) OSRF_BRANCH="$OPTARG";;
42 u) EG_BRANCH="$OPTARG";;
48 sudo su - opensrf <<'EOF'
49 PATH=$PATH:/openils/bin osrf_control --localhost --stop-all
55 cd $OSRF_HOME_DIR/$OSRF_GIT
59 sudo su - opensrf <<EOF
60 cd $OSRF_HOME_DIR/$OSRF_GIT
61 git checkout $OSRF_BRANCH
63 ./configure --prefix=/openils --sysconfdir=/openils/conf
68 cd $OSRF_HOME_DIR/$OSRF_GIT
75 cd $OSRF_HOME_DIR/$EG_GIT
79 sudo su - opensrf <<EOF
80 cd $OSRF_HOME_DIR/$EG_GIT
81 git checkout $EG_BRANCH
83 ./configure --prefix=/openils --sysconfdir=/openils/conf
88 cd $OSRF_HOME_DIR/$EG_GIT
89 make STAFF_CLIENT_STAMP_ID=$STAMP_ID install
94 sudo su - opensrf <<'EOF'
95 PATH=$PATH:/openils/bin osrf_control --localhost --start-all
96 PATH=$PATH:/openils/bin autogen.sh -u
101 if [ -z "$(dpkg -l | grep -w nsis | grep ii)" ]; then
102 echo "NSIS not installed."
103 sudo apt-get -yq install nsis
108 sudo su - opensrf <<EOF
109 cd $OSRF_HOME_DIR/$EG_GIT/Open-ILS/xul/staff_client
117 sudo cp $OSRF_HOME_DIR/$EG_GIT/Open-ILS/xul/staff_client/evergreen_staff_client_setup.exe $HOME_DIR
118 echo "The Windows Staff Client installer is located at $HOME_DIR/evergreen_staff_client_setup.exe."
123 /etc/init.d/apache2 restart
127 if [ ! -z "$UPGRADE_OSRF" ]; then
131 elif [ ! -z "$UPGRADE_EG" ]; then
144 if [ ! -z "$BUILD_CLIENT" ]; then