Skip to content
Snippets Groups Projects
sprint_post_install.sh 3.42 KiB
Newer Older
  • Learn to ignore specific revisions
  • kohleman's avatar
    kohleman committed
    #!/bin/sh
    # Central post install script for all openBIS servers
    
    
    export BIN=~/bin
    
    kohleman's avatar
    kohleman committed
    export SERVER=`uname -n`
    
    export SPRINT=cisd-bamus
    export DEMO=cisd-tongariro
    export YEASTX=imsb-us-openbis.ethz.ch
    
    kohleman's avatar
    kohleman committed
    export PHOSPHONETX=openbis-phosphonetx.ethz.ch
    export LIVERX=openbis-liverx.ethz.ch
    
    export AGRONOMICS=bs-dsvr11.ethz.ch
    export DSU=openbis-dsu
    export SCU=openbis-scu
    
    kohleman's avatar
    kohleman committed
    export BASYSBIO=bs-dsvr10.ethz.ch
    
    export BASYSBIO_TEST=openbis-test
    
    kohleman's avatar
    kohleman committed
    export CINA=bs-openbis01.ethz.ch
    
    kohleman's avatar
    kohleman committed
    
    function create_individual_greeting_message {
    # Creates an individual greeting message
    
    kohleman's avatar
    kohleman committed
    	if [ -f ~openbis/config/openbis_instance.txt ]; then
    
    	   export OPENBIS_DICT=~openbis/sprint/openBIS-server/apache-tomcat/webapps/openbis/common-dictionary.js
    
    kohleman's avatar
    kohleman committed
    	   export SERVER_INSTANCE_NAME=`cat ~openbis/config/openbis_instance.txt`
    
    kohleman's avatar
    kohleman committed
    	   perl -pe 's/openbis_instance: "",/openbis_instance: "$ENV{SERVER_INSTANCE_NAME}",/' -i $OPENBIS_DICT
    
    kohleman's avatar
    kohleman committed
    	fi
    }
    
    
    kohleman's avatar
    kohleman committed
    function restore_loginHeader {
    
    kohleman's avatar
    kohleman committed
      if [ -f ~openbis/config/loginHeader.html ]; then
    
        echo restoring loginHeader.html...
    
    kohleman's avatar
    kohleman committed
        cp -r ~openbis/config/images ~openbis/sprint/openBIS-server/apache-tomcat/webapps/openbis/
        cp ~openbis/config/loginHeader.html ~openbis/sprint/openBIS-server/apache-tomcat/webapps/openbis/
        cp ~openbis/config/help.html ~openbis/sprint/openBIS-server/apache-tomcat/webapps/openbis/
    
      fi
      if [ -f ~openbis/config/index.html ]; then
      	cp ~openbis/config/index.html  ~openbis/sprint/openBIS-server/apache-tomcat/webapps/openbis/
      fi  
      if  [ -f ~openbis/config/datastore_log.xml ]; then
    
      	cp ~openbis/config/datastore_log.xml ~openbis/sprint/datastore_server/etc/log.xml
    
    function add_yeastx_plugin {
    	 echo copying yeastx...
    
    	 cd ~openbis/config
    
    	 unzip ~openbis/config/datastore_server_plugin*.zip
    
    	 mv -f ~openbis/config/lib/datastore_server-plugins.jar ~openbis/sprint/datastore_server/lib
    
    	 rmdir ~openbis/config/lib
    
    	 rm -f ~openbis/config/datastore_server_plugin*.zip
    
    kohleman's avatar
    kohleman committed
    case "$SERVER" in
    
    	$SPRINT)
    	echo SPRINT:$SPRINT;
    
    	restore_loginHeader
    	create_individual_greeting_message
    	
    
    kohleman's avatar
    kohleman committed
    	$BIN/sprint_post_install_sprint.sh
    
    kohleman's avatar
    kohleman committed
    	;;
    	$DEMO)
    
    	restore_loginHeader
    	create_individual_greeting_message
    
    kohleman's avatar
    kohleman committed
    	echo DEMO:$DEMO;
    
    kohleman's avatar
    kohleman committed
    	$BIN/sprint_post_install_demo.sh
    
    kohleman's avatar
    kohleman committed
    	;;
    	$YEASTX)
    
    	restore_loginHeader
    	create_individual_greeting_message
    
    kohleman's avatar
    kohleman committed
    	echo YEASTX:$YEASTX;
    
    kohleman's avatar
    kohleman committed
    	$BIN/sprint_post_install_yeastx.sh
    
    kohleman's avatar
    kohleman committed
    	;;
    	$PHOSPHONETX)
    
    	restore_loginHeader
    	create_individual_greeting_message
    
    kohleman's avatar
    kohleman committed
    	echo PHOSPHONETX:$PHOSPHONETX;
    	;;
    	$LIVERX)
    
    	restore_loginHeader
    	create_individual_greeting_message
    
    kohleman's avatar
    kohleman committed
    	echo LIVERX:$LIVERX;
    	;;
    	$AGRONOMICS)
    	echo AGRONOMICS:$AGRONOMICS;
    
    kohleman's avatar
    kohleman committed
    	restore_loginHeader
    
    kohleman's avatar
    kohleman committed
    	create_individual_greeting_message
    
    	$BIN/sprint_post_install_agronomics.sh
    
    kohleman's avatar
    kohleman committed
    	;;
    
    	$DSU)
    	echo DSU:$DSU;
    	restore_loginHeader
    	create_individual_greeting_message
    
    	DSU_SERVER_HOME=~openbis/sprint/openBIS-server/apache-tomcat-5.5.26/webapps/openbis
    
    kohleman's avatar
    kohleman committed
        cp ~openbis/config/openBIS_for_DSU.pdf $DSU_SERVER_HOME
    
    kohleman's avatar
    kohleman committed
    	restore_loginHeader
    	create_individual_greeting_message
    
    kohleman's avatar
    kohleman committed
    	;;
    	$BASYSBIO)
    	echo BASYSBIO:$BASYSBIO;
    
    kohleman's avatar
    kohleman committed
    	restore_loginHeader
    
    kohleman's avatar
    kohleman committed
    	create_individual_greeting_message
    
    	$BIN/sprint_post_install_basysbio.sh
    	;;
    	$BASYSBIO_TEST)
    	echo BASYSBIO_TEST:$BASYSBIO_TEST;
    	restore_loginHeader
    	create_individual_greeting_message
    
    kohleman's avatar
    kohleman committed
    	$BIN/sprint_post_install_basysbio.sh
    
    kohleman's avatar
    kohleman committed
    	;;
    
    kohleman's avatar
    kohleman committed
    	$CINA)
    	echo DSU:$CINA;
    	restore_loginHeader
    	create_individual_greeting_message
    	;;
    
    kohleman's avatar
    kohleman committed
    	*)
    	echo Wrong Server! $SERVER is not in the list of openBIS Servers.;
    	exit 1;
    	;;
    
    kohleman's avatar
    kohleman committed
    esac