Skip to content
Snippets Groups Projects
Commit 4e1925ec authored by kaloyane's avatar kaloyane
Browse files

use a temporary folder when installing/upgrading openBIS-server. This way the...

use a temporary folder when installing/upgrading openBIS-server. This way the end-installation is not polluted with remnants from the archive.

SVN: 22001
parent 2943ed9e
No related branches found
No related tags found
No related merge requests found
......@@ -39,4 +39,43 @@ copyIfExists()
if [ -f "$1" ]; then
cp "$1" "$2"
fi
}
\ No newline at end of file
}
#
# Installs openBIS server to a given destination
# The function assumes that the openBIS-server*.zip file is already present in the destination.
#
installOpenBisServer()
{
if [ "$1" == "" ]; then
echo "ERROR: You must specify a folder to install openBIS-server"
exit 1
fi
INSTALL_DIR=$1
TMP_EXTRACT=$INSTALL_DIR/tmp-extract
echo Installing openBIS Application Server to $INSTALL_DIR
mkdir -p "$TMP_EXTRACT"
mkdir $INSTALL_DIR/openBIS-server
unzip $INSTALL_DIR/openBIS-*.zip -d "$TMP_EXTRACT"
$TMP_EXTRACT/openBIS-server/install.sh $INSTALL_DIR/openBIS-server
rm -rf "$TMP_EXTRACT"
}
#
# Installs Data Store Server to a given destination
# The function assumes that the datastore-server*.zip file is already present in the destination.
#
installDataStoreServer()
{
if [ "$1" == "" ]; then
echo "ERROR: You must specify a folder to install Data Store Server"
exit 1
fi
INSTALL_DIR=$1
echo Installing openBIS Datastore Server to $INSTALL_DIR
unzip $INSTALL_DIR/datastore*.zip -d $INSTALL_DIR
}
......@@ -8,6 +8,7 @@ if [ ${BASE#/} == ${BASE} ]; then
fi
source $BASE/env
source $BASE/common-functions.sh
ROOT_DIR=$BASE/../servers
BACKUP_DIR=$BASE/../backup
......@@ -15,15 +16,8 @@ BACKUP_DIR=$BASE/../backup
mkdir -p $ROOT_DIR
mkdir -p $BACKUP_DIR
echo Installing openBIS Datastore Server
unzip $ROOT_DIR/datastore*.zip -d $ROOT_DIR
echo Installing openBIS Application Server
TMP_EXTRACT=$ROOT_DIR/tmp-extract
mkdir -p "$TMP_EXTRACT"
mkdir $ROOT_DIR/openBIS-server
unzip $ROOT_DIR/openBIS-*.zip -d "$TMP_EXTRACT"
$TMP_EXTRACT/openBIS-server/install.sh $ROOT_DIR/openBIS-server
installOpenBisServer $ROOT_DIR
installDataStoreServer $ROOT_DIR
rm -rf "$TMP_EXTRACT"
mv $ROOT_DIR/*.zip $BACKUP_DIR/
......
......@@ -8,6 +8,7 @@ if [ ${BASE#/} == ${BASE} ]; then
fi
source $BASE/env
source $BASE/common-functions.sh
ROOT_DIR=$BASE/../servers
......@@ -34,12 +35,8 @@ mv $ROOT_DIR/datastore_server $BACKUP_DIR/datastore_server
# pg_restore -d db-name db-file.dmp
pg_dump -U $DB_USER_NAME -Fc $OPENBIS_DB > $BACKUP_DIR/$OPENBIS_DB-${NOW}.dmp
echo Installing openBIS Datastore Server
unzip -qo $ROOT_DIR/datastore_server-screening*.zip -d $ROOT_DIR
echo Installing openBIS Application Server
unzip -qo $ROOT_DIR/openBIS-*.zip -d $ROOT_DIR
$ROOT_DIR/openBIS-server/install.sh $ROOT_DIR/openBIS-server
installOpenBisServer $ROOT_DIR
installDataStoreServer $ROOT_DIR
$BASE/restore-config-from-backup.sh $CONFIG
cp -r $OLD_BIS/jetty/indices* $ROOT_DIR/openBIS-server/jetty/
......
......@@ -39,4 +39,43 @@ copyIfExists()
if [ -f "$1" ]; then
cp -R "$1" "$2"
fi
}
\ No newline at end of file
}
#
# Installs openBIS server to a given destination
# The function assumes that the openBIS-server*.zip file is already present in the destination.
#
installOpenBisServer()
{
if [ "$1" == "" ]; then
echo "ERROR: You must specify a folder to install openBIS-server"
exit 1
fi
INSTALL_DIR=$1
TMP_EXTRACT=$INSTALL_DIR/tmp-extract
echo Installing openBIS Application Server to $INSTALL_DIR
mkdir -p "$TMP_EXTRACT"
mkdir $INSTALL_DIR/openBIS-server
unzip $INSTALL_DIR/openBIS-*.zip -d "$TMP_EXTRACT"
$TMP_EXTRACT/openBIS-server/install.sh $INSTALL_DIR/openBIS-server
rm -rf "$TMP_EXTRACT"
}
#
# Installs Data Store Server to a given destination
# The function assumes that the datastore-server*.zip file is already present in the destination.
#
installDataStoreServer()
{
if [ "$1" == "" ]; then
echo "ERROR: You must specify a folder to install Data Store Server"
exit 1
fi
INSTALL_DIR=$1
echo Installing openBIS Datastore Server to $INSTALL_DIR
unzip $INSTALL_DIR/datastore*.zip -d $INSTALL_DIR
}
......@@ -8,6 +8,7 @@ if [ ${BASE#/} == ${BASE} ]; then
fi
source $BASE/env
source $BASE/common-functions.sh
ROOT_DIR=$BASE/../servers
BACKUP_DIR=$BASE/../backup
......@@ -15,17 +16,9 @@ BACKUP_DIR=$BASE/../backup
mkdir -p $ROOT_DIR
mkdir -p $BACKUP_DIR
echo Installing openBIS Datastore Server
unzip $ROOT_DIR/datastore*.zip -d $ROOT_DIR
installOpenBisServer $ROOT_DIR
installDataStoreServer $ROOT_DIR
echo Installing openBIS Application Server
TMP_EXTRACT=$ROOT_DIR/tmp-extract
mkdir -p "$TMP_EXTRACT"
mkdir $ROOT_DIR/openBIS-server
unzip $ROOT_DIR/openBIS-*.zip -d "$TMP_EXTRACT"
$TMP_EXTRACT/openBIS-server/install.sh $ROOT_DIR/openBIS-server
rm -rf "$TMP_EXTRACT"
mv $ROOT_DIR/*.zip $BACKUP_DIR/
. $BASE/create-empty-screening-db.sh
......
......@@ -8,6 +8,7 @@ if [ ${BASE#/} == ${BASE} ]; then
fi
source $BASE/env
source $BASE/common-functions.sh
ROOT_DIR=$BASE/../servers
......@@ -36,12 +37,8 @@ $PG_DUMP -U $DB_USER_NAME -Fc $OPENBIS_DB > $BACKUP_DIR/$OPENBIS_DB-${NOW}.dmp
# screening-specific
$PG_DUMP -U $DB_USER_NAME -Fc $IMAGING_DB > $BACKUP_DIR/$IMAGING_DB-${NOW}.dmp
echo Installing openBIS Datastore Server
unzip $ROOT_DIR/datastore_server-screening*.zip -d $ROOT_DIR
echo Installing openBIS Application Server
unzip $ROOT_DIR/openBIS-server*.zip -d $ROOT_DIR
$ROOT_DIR/openBIS-server/install.sh $ROOT_DIR/openBIS-server
installOpenBisServer $ROOT_DIR
installDataStoreServer $ROOT_DIR
$BASE/restore-config-from-backup.sh $CONFIG
cp -r $OLD_BIS/jetty/indices* $ROOT_DIR/openBIS-server/jetty/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment