From ad63d56d4ff3983a2675d0f4d1a86f93045dcb99 Mon Sep 17 00:00:00 2001 From: Chris Sharp Date: Wed, 17 Feb 2016 09:55:22 -0500 Subject: [PATCH] adding script to automatically upgrade to stock OpenSRF and Evergreen master --- upgrade.sh | 150 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100755 upgrade.sh diff --git a/upgrade.sh b/upgrade.sh new file mode 100755 index 0000000..cc40461 --- /dev/null +++ b/upgrade.sh @@ -0,0 +1,150 @@ +#!/bin/bash +# +# (C) Copyright 2016 Georgia Public Library Service +# Chris Sharp +# +# This script assumes that you have already installed and configured +# OpenSRF and Evergreen using the git repository. It also assumes that +# the repositories exist in /home/opensrf and are named 'OpenSRF' and +# 'Evergreen'. +# + +STAMP_ID="evergreen-master" +HOME_DIR=${HOME} +OSRF_BRANCH="master" +EG_BRANCH="master" +OSRF_HOME_DIR="/home/opensrf" +OSRF_GIT="OpenSRF" +EG_GIT="Evergreen" + +Usage() { +echo +echo "Usage: $0 [-o] [-e] [-c] [-t opensrf_git_branch] [-u evergreen_git_branch] [-h]" +echo +echo "Without any parameters, this script upgrades both Evergreen" +echo "and OpenSRF to their current master versions" +echo "-o = Upgrade OpenSRF Only" +echo "-e = Upgrade Evergreen Only" +echo "-c = Additionally Build a Windows Staff Client" +echo "-t = Use the named OpenSRF git branch rather than master" +echo "-u = Use the named Evergreen git branch rather than master" +echo "-h = Show this message" +echo +exit 1; +} + +while getopts eocu:t:h OPTIONS +do case "$OPTIONS" in + o) UPGRADE_OSRF=1;; + e) UPGRADE_EG=1;; + c) BUILD_CLIENT=1;; + t) OSRF_BRANCH="$OPTARG";; + u) EG_BRANCH="$OPTARG";; + h) Usage; exit 1;; + esac +done + +StopOpenSRF() { +sudo su - opensrf <<'EOF' +PATH=$PATH:/openils/bin osrf_control --localhost --stop-all +EOF +} + +UpgradeOpenSRF() { +sudo su <