From ca582a3d6118153332931e0bb4f478e7f6f115f9 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 8 Dec 2014 15:47:56 -0500 Subject: [PATCH] turn staff client publisher into generic post-install script Signed-off-by: Bill Erickson --- KCLS/misc-scripts/post-install-tasks.sh | 57 +++++++++++++++++++++++++++++++ KCLS/misc-scripts/publish-staff-client.sh | 41 ---------------------- 2 files changed, 57 insertions(+), 41 deletions(-) create mode 100755 KCLS/misc-scripts/post-install-tasks.sh delete mode 100755 KCLS/misc-scripts/publish-staff-client.sh diff --git a/KCLS/misc-scripts/post-install-tasks.sh b/KCLS/misc-scripts/post-install-tasks.sh new file mode 100755 index 0000000000..86de021ead --- /dev/null +++ b/KCLS/misc-scripts/post-install-tasks.sh @@ -0,0 +1,57 @@ +#!/bin/bash +# ----------------------------------------------------------------------- +# Author: Bill Erickson +# +set -euo pipefail +BUILD_ID='' +XUL_DIR=/openils/var/web/xul + +while getopts "b:" opt; do + case $opt in + b) BUILD_ID="$OPTARG" + esac +done; + +[ -z "$BUILD_ID" ] && echo "-b required!" && exit; +[ "$(id -un)" != "opensrf" ] && echo "Run as opensrf!" && exit; + + + +# ----------------------------------------------------------------------- +# 1. Create persistent links to current staff client server directory +# 2. Make staff client build directories available for easy download +# from an Evergreen brick. +# ----------------------------------------------------------------------- +function publish_staff_client_build { + + cd /home/opensrf/Evergreen/ + mkdir -p $XUL_DIR/builds/ + cp -r Open-ILS/xul/staff_client/build $XUL_DIR/builds/ + cd $XUL_DIR + + # set up links to current server files + + rm -f server + rm -f current + ln -s $BUILD_ID current + ln -s current/server server + + # create current build bundle zip file + + cd builds + rm -r build/server # server files are not needed by installed clients + rm -f current-client-build.zip + zip -rq $BUILD_ID.zip build + ln -s $BUILD_ID.zip current-client-build.zip + rm -r build # don't need the extracted version on the server +} + +# copy custom files into place +function copy_custom_files { + cd /home/opensrf/Evergreen/ + # web templates + cp -r KCLS/openils/var/templates_kcls /openils/var/ +} + +publish_staff_client_build; +copy_custom_files; diff --git a/KCLS/misc-scripts/publish-staff-client.sh b/KCLS/misc-scripts/publish-staff-client.sh deleted file mode 100755 index 6569b51adf..0000000000 --- a/KCLS/misc-scripts/publish-staff-client.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# ----------------------------------------------------------------------- -# Author: Bill Erickson -# -# 1. Make staff client build directories available for easy download -# from an Evergreen brick. -# 2. Create persistent links to current staff client server directory -# ----------------------------------------------------------------------- -set -euo pipefail -BUILD_ID='' -XUL_DIR=/openils/var/web/xul - -while getopts "b:" opt; do - case $opt in - b) BUILD_ID="$OPTARG" - esac -done; - -[ -z "$BUILD_ID" ] && echo "-b required!" && exit; -[ "$(id -un)" != "opensrf" ] && echo "Run as opensrf!" && exit; - -cd /home/opensrf/Evergreen/ -mkdir -p $XUL_DIR/builds/ -cp -r Open-ILS/xul/staff_client/build $XUL_DIR/builds/ -cd $XUL_DIR - -# set up links to current server files - -rm -f server -rm -f current -ln -s $BUILD_ID current -ln -s current/server server - -# create current build bundle zip file - -cd builds -rm -r build/server # reduce file size; server files not needed by installed client -rm -f current-client-build.zip -zip -rq $BUILD_ID.zip build -ln -s $BUILD_ID.zip current-client-build.zip -rm -r build # don't need the extracted version on the server -- 2.11.0