diff --git a/openbis/dist/admin/common-functions.sh b/openbis/dist/admin/common-functions.sh index 2a00c32541f3467947bb8b624248fc0ba9860771..c300cecaed4e6b0c4a3d003fa2c7ab6ad664b8fc 100644 --- a/openbis/dist/admin/common-functions.sh +++ b/openbis/dist/admin/common-functions.sh @@ -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 +} diff --git a/openbis/dist/admin/install.sh b/openbis/dist/admin/install.sh index 9ba6a02932cc31d572dd065949d89e8c8e93172a..80a2ef1826f1af9c6f14e5fe89599b2dd0a68698 100755 --- a/openbis/dist/admin/install.sh +++ b/openbis/dist/admin/install.sh @@ -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/ diff --git a/openbis/dist/admin/upgrade.sh b/openbis/dist/admin/upgrade.sh index 0d4bdfe0cdcb45a811d9941355169f4bbcb6b39f..c876c12acb700ff0f06eb7414a7d032840e03fe7 100755 --- a/openbis/dist/admin/upgrade.sh +++ b/openbis/dist/admin/upgrade.sh @@ -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/ diff --git a/screening/dist/admin/common-functions.sh b/screening/dist/admin/common-functions.sh index 63283870d5c3ac02531765124462070f2c416700..8b4e3cffb0879dbf66831e461e6ba6946b529dbc 100644 --- a/screening/dist/admin/common-functions.sh +++ b/screening/dist/admin/common-functions.sh @@ -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 +} diff --git a/screening/dist/admin/install.sh b/screening/dist/admin/install.sh index 8b2f6a231de0f109b199c94523616ad8677b5a1e..f133e2676f4c139b8977945e4b20cf3e15df739d 100755 --- a/screening/dist/admin/install.sh +++ b/screening/dist/admin/install.sh @@ -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 diff --git a/screening/dist/admin/upgrade.sh b/screening/dist/admin/upgrade.sh index e52a7c1eb496c5a0cde1b3ae82ea27262a1ad0c2..68d3b9fdd9ead8d19e7dbe263c7e27d17b5f3812 100755 --- a/screening/dist/admin/upgrade.sh +++ b/screening/dist/admin/upgrade.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/