[pal-cvs 2461] [193] added upgrade script

Zurück zum Archiv-Index

svnno****@sourc***** svnno****@sourc*****
2007年 6月 23日 (土) 22:16:44 JST


Revision: 193
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=193
Author:   shinsuke
Date:     2007-06-23 22:16:44 +0900 (Sat, 23 Jun 2007)

Log Message:
-----------
added upgrade script

Added Paths:
-----------
    pal-portal/trunk/portal/scripts/upgrade.sh


-------------- next part --------------
Added: pal-portal/trunk/portal/scripts/upgrade.sh
===================================================================
--- pal-portal/trunk/portal/scripts/upgrade.sh	2007-06-22 00:57:03 UTC (rev 192)
+++ pal-portal/trunk/portal/scripts/upgrade.sh	2007-06-23 13:16:44 UTC (rev 193)
@@ -0,0 +1,112 @@
+#!/bin/sh
+
+help () {
+    echo "  upgrade.sh -p <arg> -i <arg> -n <arg>"
+    echo "    -p <arg> Installed portal."
+    echo "             ex. <tomcat_home>"
+    echo "    -i <arg> New portal image."
+    echo "    -n <arg> Portal name."
+    echo "             ex. palportal"
+}
+
+while getopts p:i:n: opt
+do
+    case ${opt} in
+        p)
+            INSTALLED_PORTAL_DIR=${OPTARG};;
+        i)
+            NEW_PORTAL_DIR=${OPTARG};;
+        n)
+            PORTAL_NAME=${OPTARG};;
+        \?)
+            help;
+            exit 1;;
+    esac
+done
+
+if [ x$INSTALLED_PORTAL_DIR = "x" -o x$NEW_PORTAL_DIR = "x" -o x$PORTAL_NAME = "x" ] ; then
+    help;
+    exit 1;
+fi
+
+# conf/Catalina/localhost
+cp $NEW_PORTAL_DIR/conf/Catalina/localhost/* $INSTALLED_PORTAL_DIR/conf/Catalina/localhost
+
+# shared/lib
+rm -f $INSTALLED_PORTAL_DIR/shared/lib/jetspeed*
+rm -f $INSTALLED_PORTAL_DIR/shared/lib/portlet*
+rm -f $INSTALLED_PORTAL_DIR/shared/lib/portals*
+rm -f $INSTALLED_PORTAL_DIR/shared/lib/derby* 
+rm -f $INSTALLED_PORTAL_DIR/shared/lib/pluto*
+
+cp $NEW_PORTAL_DIR/shared/lib/* $INSTALLED_PORTAL_DIR/shared/lib/
+
+# webapps/$PORTAL_NAME
+rm -f $INSTALLED_PORTAL_DIR/webapps/$PORTAL_NAME/WEB-INF/lib/*
+PORTAL_PAGES_DIR=/tmp/portal_pages_dir.$$
+mv $INSTALLED_PORTAL_DIR/webapps/$PORTAL_NAME/WEB-INF/pages $PORTAL_PAGES_DIR
+PORTAL_CONF_DIR=/tmp/portal_conf_dir.$$
+mv $INSTALLED_PORTAL_DIR/webapps/$PORTAL_NAME/WEB-INF/conf $PORTAL_CONF_DIR
+PORTAL_ASSEMBLY_DIR=/tmp/portal_assembly_dir.$$
+mv $INSTALLED_PORTAL_DIR/webapps/$PORTAL_NAME/WEB-INF/assembly $PORTAL_ASSEMBLY_DIR
+PORTAL_DECORATIONS_DIR=/tmp/portal_decorations_dir.$$
+mv $INSTALLED_PORTAL_DIR/webapps/$PORTAL_NAME/decorations/ $PORTAL_DECORATIONS_DIR
+
+cp -r $NEW_PORTAL_DIR/webapps/$PORTAL_NAME $INSTALLED_PORTAL_DIR/webapps/
+
+# pages
+echo "======================================================================"
+echo "Do you want to use new pages(PSML files) (y|n)?"
+read answer
+case $answer in
+    yes | YES | Yes | y | Y)
+       echo "Replaced with new pages.";;
+    *)
+       rm -rf $INSTALLED_PORTAL_DIR/webapps/$PORTAL_NAME/WEB-INF/pages;
+       mv $PORTAL_PAGES_DIR $INSTALLED_PORTAL_DIR/webapps/$PORTAL_NAME/WEB-INF/pages;
+       echo "Use existing pages.";;
+esac
+
+# conf
+echo "======================================================================"
+echo "Do you want to use new configuration files (y|n)?"
+read answer
+case $answer in
+    yes | YES | Yes | y | Y)
+       echo "Replaced with new configuration files.";;
+    *)
+       rm -rf $INSTALLED_PORTAL_DIR/webapps/$PORTAL_NAME/WEB-INF/conf;
+       mv $PORTAL_CONF_DIR $INSTALLED_PORTAL_DIR/webapps/$PORTAL_NAME/WEB-INF/conf;
+       echo "Use existing configuration files.";;
+esac
+
+# assembly
+echo "======================================================================"
+echo "Do you want to use new assembly files(spring files) (y|n)?"
+read answer
+case $answer in
+    yes | YES | Yes | y | Y)
+       echo "Replaced with new assembly files.";;
+    *)
+       rm -rf $INSTALLED_PORTAL_DIR/webapps/$PORTAL_NAME/WEB-INF/assembly;
+       mv $PORTAL_ASSEMBLY_DIR $INSTALLED_PORTAL_DIR/webapps/$PORTAL_NAME/WEB-INF/assembly;
+       echo "Use existing assembly files.";;
+esac
+
+# decorations
+echo "======================================================================"
+echo "Do you want to use new decorations files (y|n)?"
+read answer
+case $answer in
+    yes | YES | Yes | y | Y)
+       echo "Replaced with new decorations files.";;
+    *)
+       rm -rf $INSTALLED_PORTAL_DIR/webapps/$PORTAL_NAME/WEB-INF/decorations;
+       mv $PORTAL_DECORATIONS_DIR $INSTALLED_PORTAL_DIR/webapps/$PORTAL_NAME/WEB-INF/decorations;
+       echo "Use existing decorations files.";;
+esac
+
+# webapps/j2-admin.war
+cp $NEW_PORTAL_DIR/webapps/j2-admin.war $INSTALLED_PORTAL_DIR/webapps/
+
+


Property changes on: pal-portal/trunk/portal/scripts/upgrade.sh
___________________________________________________________________
Name: svn:eol-style
   + native


pal-cvs メーリングリストの案内
Zurück zum Archiv-Index