← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17893: Script

 

------------------------------------------------------------
revno: 17893
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-01-06 17:04:04 +0100
message:
  Script
modified:
  resources/util/tomcat


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'resources/util/tomcat'
--- resources/util/tomcat	2014-12-16 17:16:43 +0000
+++ resources/util/tomcat	2015-01-06 16:04:04 +0000
@@ -3,6 +3,11 @@
 TOMCAT_LOCAL=~/dev/lib/tomcat
 DHIS2_SOURCE_HOME=~/dev/src/dhis2
 
+if [ $# -eq 0 ]
+  then
+    echo "Usage: tomcat [option] [version]"
+fi
+
 case $1 in
 start) 
   ${TOMCAT_LOCAL}/bin/startup.sh
@@ -29,6 +34,7 @@
 clear)
   sudo rm -rf ${TOMCAT_LOCAL}/webapps/dhis
   sudo rm ${TOMCAT_LOCAL}/webapps/dhis.war
+  echo Tomcat WAR cleared
   ;;
 update)
   sudo rm -rf ${TOMCAT_LOCAL}/webapps/dhis
@@ -36,6 +42,17 @@
   sudo cp ${DHIS2_SOURCE_HOME}/dhis-2/dhis-web/dhis-web-portal/target/dhis.war ${TOMCAT_LOCAL}/webapps/
   echo Tomcat updated with latest WAR from src code
   ;;
+get)
+  if [ $# -eq 1 ]
+  then
+    echo "Usage: tomcat get [version]"
+  fi
+  
+  sudo rm -rf ${TOMCAT_LOCAL}/webapps/dhis
+  sudo rm ${TOMCAT_LOCAL}/webapps/dhis.war
+  wget -O ${TOMCAT_LOCAL}/webapps/dhis.war http://stable.dhis2.org/${2}
+  echo Tomcat updated with WAR version ${2} from stable.dhis2.org
+  ;;
 esac
 exit 0