#!/bin/csh -f # deploy # ------------------------------------------------------------------------------ # Shell script to deploy a Web App to local Tomcat. # ------------------------------------------------------------------------------ # Revision History: # $Log$ # ------------------------------------------------------------------------------ if ($#argv == 0 || "$1" == "-h" || "$1" == "--help") then echo "Usage: $0:t deployment_descriptor_filename_without_xml_extension" echo " - Deploys web app via specified XML file." echo " $0:t xml deployment_descriptor_filename_without_xml_extension" echo " - Deploys web app via specified XML file." echo " $0:t war war_filename_without_war_extension" echo " - Deploys web app via specified WAR file." echo " $0:t dir app_directory_name app_name" echo " - Deploys web app via specified directory tree." exit 1 endif if ("$1" == "xml") then # Copy app's XML deployment descriptor to the local Tomcat configuration # directory. Tomcat will read it to find where the app files reside, and # run the app from there. cp -i -v "$2.xml" "$CATALINA_HOME/conf/Catalina/localhost/" else if ("$1" == "war") then # Copy app's WAR file to the local Tomcat webapps directory. Tomcat will # expand it to a directory tree under webapps, and run it from there. cp -i -v "$2.war" "$CATALINA_HOME/webapps/" else if ("$1" == "dir") then # Copy app's directory tree to the local Tomcat webapps directory. # Tomcat will run it from there. if ($#argv < 3) then echo "Error: dir must be followed by 2 arguments" $0:q --help else cp -i -v -R "$2/*" "$CATALINA_HOME/webapps/$3/" endif else # Default first param to xml. $0:q xml $1:q endif exit 0