Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added a reminder to commit/push runtime properties

...

  1. Add a DIY cartridge.
  2. Add MySQL cartridge to the previously created one (OpenShift console -> cartridge -> Databases -> Add MySQL).
  3. Prepare to change the cartridge:
    1. Clone its repository: 
      1. git clone ssh://$OPENSHIFT_APP_UUID@$OPENSHIFT_APP_DNS/~/git/openmrs.git/
    2. Move to the resulting directory:

      1. cd openmrs/
  4. Deploy custom Tomcat (Custom here means not the default one for OpenShift. In fact, this variant is upstream.)

    1. git remote add tomcat-upstream -m master git://github.com/openshift-quickstart/openshift-tomcat-quickstart.git
    2. git pull -s recursive -X theirs tomcat-upstream master
    3. git push
    4. Check if Tomcat has started successfully by visiting your server via browser (URL is written on cartridge's page in console).
  5. Deploy OpenMRS to server:
    1. Download the app archive (version specified here is the most recent one by the time of writing) into tomcat webapps directory:
      1. curl -L http://sourceforge.net/projects/openmrs/files/releases/OpenMRS_Platform_1.10.1/openmrs.war/download -o diy/tomcat/webapps/openmrs.war
    2. git add diy/tomcat/webapps/openmrs.war
    3. git commit -m 'Deployed OpenMRS Platform 1.10.1'
    4. git push
    5. Check if it has started succesfully by visiting http://$OPENSHIFT_APP_DNS/openmrs (default path).

  6. Configure OpenMRS on low level: (using custom openmrs runtime properties file method: Overriding OpenMRS Default Runtime Properties)
    1. Set proper OpenMRS configuration file path (via env var):

      1. ssh to the server

      2. echo "/var/lib/openshift/$OPENSHIFT_APP_UUID/app-deployments/current/repo/diy/openmrs/openmrs-runtime.properties" > .env/user_vars/OPENMRS_RUNTIME_PROPERTIES_FILE
    2. Set proper app data directory (default is ~/.OpenMRS):

      1. mkdir diy/openmrs
      2. echo "application_data_directory=/var/lib/openshift/$OPENSHIFT_APP_UUID/app-deployments/current/repo/diy/openmrs" > diy/openmrs/openmrs-runtime.properties
    3. Add MySQL configuration to OpenMRS config:

      1. echo "### Database connection properties
        connection.username=$OPENSHIFT_MYSQL_DB_USERNAME
        connection.password=$OPENSHIFT_MYSQL_DB_PASSWORD
        connection.url=jdbc:mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/$OPENSHIFT_APP_NAME?autoReconnect=true" >> diy/openmrs/openmrs-runtime.properties
    4. Commit and push the changes:
      1. git add diy/openmrs/openmrs-runtime.properties
      2. git commit -m 'Configured OpenMRS'
      3. git push
  7. Proceed to high-level OpenMRS configuration via browser. You should not select 'Simple' as type of installation as it assumes having MySQL root, etc.

...