From a198d10ba86c08d84d707704654cf206c42fb040 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 17 May 2011 01:20:07 -0700 Subject: Supporting backlinking for release branches. --- opentox-ruby.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 opentox-ruby.sh diff --git a/opentox-ruby.sh b/opentox-ruby.sh old mode 100755 new mode 100644 index 5fcff1c..08c37ef --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -70,7 +70,7 @@ mkdir -p "$HOME/.opentox/log" >>$LOG 2>&1 cmd="sed -e \"s,SERVERNAME,$servername,;s,ESCAPEDSERVER,$escapedserver,;s,LOGGER,$logger,;s,AA,$aa,;s,WWW_DEST,$WWW_DEST,\" production.yaml > $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config 1" cmd="sed -e \"s,SERVERNAME,$servername,;s,ESCAPEDSERVER,$escapedserver,;s,LOGGER,$logger,;s,AA,$aa,;s,WWW_DEST,$WWW_DEST,\" aa-$OT_INSTALL.yaml >> $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config 1" -if [ "$OT_BRANCH" = "development" ]; then +if [ "$OT_BRANCH" = "development" ] || expr match "$OT_BRANCH" "release"; then mkdir -p $WWW_DEST/opentox >>$LOG 2>&1 cd $WWW_DEST/opentox >>$LOG 2>&1 rm -rf opentox-ruby >>$LOG 2>&1 -- cgit v1.2.3 From 664cc81bae5690da647cf1ef4b0c5b8dba531a91 Mon Sep 17 00:00:00 2001 From: David Vorgrimmler Date: Thu, 19 May 2011 16:16:54 +0200 Subject: Added environment update script --- environment_update.sh | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 environment_update.sh diff --git a/environment_update.sh b/environment_update.sh new file mode 100644 index 0000000..bbce708 --- /dev/null +++ b/environment_update.sh @@ -0,0 +1,77 @@ +#!/bin/sh +# Update script for OpenTox-ruby and webservices +# Authors: Andreas Maunz, David Vorgrimmler +# This script updates a productiv version of IST Opentox Services. All data will be saved and recovered. +# Make sure your web services are down befor running this script. +# You may modify some variables e.g. HOME, OTPREFIX, BACKUP_DIR. +# opentox/install is needed and has to be configured + +HOME="/home/davor" +. $HOME/.opentox-ui.sh + +OTPREFIX="$HOME/opentox" +BACKUP_DIR="$OTPREFIX/toxcreate3-backup" +mkdir $BACKUP_DIR >/dev/null 2>&1 +mkdir -p $BACKUP_DIR/tmp/dataset/public >/dev/null 2>&1 +mkdir -p $BACKUP_DIR/tmp/model/public >/dev/null 2>&1 +mkdir -p $BACKUP_DIR/tmp/validation >/dev/null 2>&1 +#mkdir -p $BACKUP_DIR/tmp/log >/dev/null 2>&1 + + +echo "Creating backup of www..." +TAR_NAME=$BACKUP_DIR/"www_`date +%y%m%d`.tar.gz" + +if [ -e $TAR_NAME ] || tar czvf $TAR_NAME "$OTPREFIX/opentox-ruby/www"; then + echo + echo "Will delete www in 10s! Press Ctrl+C to abort..." + sleep 10 + sudo rm -rf "$OTPREFIX/opentox-ruby/www" +fi + + +NGINX="`which nginx`" +RAKE="`which rake`" + +if ! [ -e "$RAKE" ]; then + echo "Rake not found." + exit 1 +fi +if ! [ -e "$NGINX" ]; then + echo "Nginx not found." + exit 1 +fi +if ! cd "$OTPREFIX/install"; then + echo "$OTPREFIX/install dir not found" +fi + + +OTINSTALL="$OTPREFIX/install/opentox-webservices.sh" +if ! [ -e "$OTINSTALL" ]; then + echo "$OTINSTALL not found." + exit 1 +fi +chmod +x $OTINSTALL +`$OTINSTALL` +echo "$OTINSTALL script end." + + +OTRUBYINSTALL="$OTPREFIX/install/opentox-ruby.sh" +if ! [ -e "$OTRUBYINSTALL" ]; then + echo "$OTRUBYINSTALL not found." + exit 1 +fi +chmod +x $OTRUBYINSTALL +`$OTRUBYINSTALL` +echo "$OTRUBYINSTALL script end." + + +echo "Extracting backup of www..." +cd / +DEST_DATASET=`echo "$OTPREFIX/opentox-ruby/www/opentox/dataset/public/*yaml" | sed 's/.\(.*\)/\1/'` +DEST_MODEL=`echo "$OTPREFIX/opentox-ruby/www/opentox/model/public/*yaml" | sed 's/.\(.*\)/\1/'` +DEST_REPORTS=`echo "$OTPREFIX/opentox-ruby/www/opentox/validation/reports" | sed 's/.\(.*\)/\1/'` +tar xzvf $TAR_NAME --wildcards $DEST_DATASET +tar xzvf $TAR_NAME --wildcards $DEST_MODEL +tar xzvf $TAR_NAME $DEST_REPORTS +cd - +echo "End of script." -- cgit v1.2.3 From 7eadbe25386b694af1be77f837c744a9fba08c29 Mon Sep 17 00:00:00 2001 From: davor Date: Thu, 19 May 2011 07:21:37 -0700 Subject: Changed some paths --- environment_update.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/environment_update.sh b/environment_update.sh index bbce708..d0beae4 100644 --- a/environment_update.sh +++ b/environment_update.sh @@ -6,11 +6,11 @@ # You may modify some variables e.g. HOME, OTPREFIX, BACKUP_DIR. # opentox/install is needed and has to be configured -HOME="/home/davor" +HOME="/home/opentox" . $HOME/.opentox-ui.sh OTPREFIX="$HOME/opentox" -BACKUP_DIR="$OTPREFIX/toxcreate3-backup" +BACKUP_DIR="$OTPREFIX/ot-server-backup" mkdir $BACKUP_DIR >/dev/null 2>&1 mkdir -p $BACKUP_DIR/tmp/dataset/public >/dev/null 2>&1 mkdir -p $BACKUP_DIR/tmp/model/public >/dev/null 2>&1 -- cgit v1.2.3