OpenMRS Web Application Update Project


Automated "In-line" OpenMRS Web Application Updates

Mentor(s): Ben Wolfe, Mike Seaton

Assigned to: Upul Godage

Abstract: OpenMRS is a J2EE web application which operates within Tomcat or another servlet container framework. Consequently, updating versions of OpenMRS requires a number of manual steps (such as updating the .WAR file, running SQL update scripts, etc). Given the growing numbers of OpenMRS implementations that have limited technical knowhow, we would like to see functionality for OpenMRS that would allow for automated updating of the application from within the application itself.

Some ideas of how such a feature would be implemented:

  • Creation of a separate daemon that existed either as a service or a seperate war which kept up with recent updates and had the ability to affect the servlet container's control of OpenMRS
  • Creation of an external application that could be called by OpenMRS to do the behind-the-scenes work
  • Use of rsync to allow for incremental, diff data transfers from mothership
  • Configurable parameters such as: updating by nightly builds vs. major point releases, updates linked to the scheduler, etc.

Target: Successful completion of this project would at the minimum allow a end user from within OpenMRS to be notified of a new OpenMRS version, and upon administrator choice, would update the web application to the most current version. The approach should work within Tomcat at a minimum, but 10 points extra credit for other servlet container support. :)

For more information, see ticket:113.

Notes The following are the options. Best preference first.


1. A web application using Apache Cargo to handle web application. Use Apache Cargo programmatically to handle WAR deployment. So this will support all Apache Cargo supported application servers. SQL scripts will be running using direct JDBC calls.

2. A web application using Tomcat manager web application as the reference. This will be writing directly to Tomcat implementation. SQL scripts will be running using direct JDBC calls.

3. A separate bundle installs the required Apache Ant and Apache Cargo in the user's machine before hand. Use a separate bundle which includes update WAR and SQL scripts available to be downloaded by the user. User downloads it and executes it with the help of already installed Ant installation. SQL scripts run using Ant tasks.

Two scenarios where AutoUpdate application deployed as a web application will behave as follows.

  • AutoUpdate will be a separate web application user has to deploy.
  • User provide the OpenMRS web application context location (e.g. openmrs)
  • Identify currently running OpenMRS instance version.
  • Lookup new updates available at the OpenMRS site and display.
  • User selects an update.
  • AutoUpdate downloads the WAR and SQL to a temporary directory (e.g. user's .OpenMRS directory)
  • AutoUpdate uses Web application server and database connection details from the .OpenMRS properties files.
  • AutoUpdate uses Apache Cargo or Tomcat manager similar code to undeploy the existing OpenMRS.
  • Runs the SQL scripts using JDBC with the .OpenMRS database connection details.
  • Deploy the new OpenMRS WAR using Apache Cargo or Tomcat manager similar code.