This repository defines the OpenMRS distribution for PIH Lesotho. It packages together the PIH EMR parent distribution, Lesotho-specific content, and the PIH EMR frontend into a single deployable artifact. For more background on OpenMRS distributions, see the OpenMRS wiki.
| Directory | Description |
|---|---|
content/ |
Lesotho-specific OpenMRS content package (Initializer and O3 configuration files) |
distro/ |
Distribution definition — resolves all component versions into openmrs-distro.properties |
| Component | Artifact |
|---|---|
| PIH EMR parent distro | org.openmrs.distro:pihemr |
| PIH EMR shared content | org.pih.openmrs:pihemr-content |
| Lesotho content | org.pih.openmrs:lesotho-content |
| PIH EMR frontend | org.pih.openmrs:openmrs-frontend-pihemr |
Component versions are defined in distro/pom.xml and resolved into distro/openmrs-distro.properties at build time.
| Site | PIH Config |
|---|---|
kol-ci |
lesotho,lesotho-kol-ci |
Developers can use the OpenMRS SDK to set up, update, and run local OpenMRS instances. All normal OpenMRS SDK commands are supported.
One can also use the openmrs-sdk command supplied by the openmrs-contrib-distro-tools CLI if that is more convenient.
Follow the installation instructions in that repo first if you wish to use this command.
Consult the openmrs-contrib-distro-tools README
for more information on each supported command and configuration option.
Whenever one creates a new SDK server, there are several options one has to configure it. One must specify the
distribution to install, the PIH Config to use, the Tomcat port, the Debug port, the Java version, and whether to
connect to an existing database or to create a new one, and whether to do so in the default SDK Docker container,
one's own Docker container, or in a native MySQL server. The openmrs-sdk documentation provides a full list of
these options, which can be set via environment variables.
The least configuration required to get up and running is to specify the PIH Config only, which will use all other defaults including the database, which will use the built-in SDK Docker container.:
PIH_CONFIG=lesotho,lesotho-kol-ci \
openmrs-sdk create <server-id>
Many developers maintain their own MySQL Docker container into which they maintain their various SDK servers. For example,
one might have an existing MySQL Docker container named mysq56 exposing port 3308, and with a root password of password.
To use this container instead, simply add the appropriate additional environment variables as documented in the README:
PIH_CONFIG=lesotho,lesotho-kol-ci \
DB_CONTAINER=mysql56 \
DB_PORT=3308 \
DB_PASSWORD=password \
openmrs-sdk create <server-id>
This is just a thin wrapper around the native OpenMRS SDK maven command:
openmrs-sdk run <server-id>openmrs-sdk update <server-id>Unlike a full update, this only updates the configuration files and is intended to be faster, suitable for more rapid iteration of content changes for testing.
openmrs-sdk update-config <server-id>For each supported configuration profile, an example environment file is provided in the repo root to get started quickly.
Because this file is found in the distribution repository, it is assumed that this is checked out on your machine, and
that openmrs-docker commands are running from the root of the distribution repository — it sets DISTRO_SOURCE_DIR
to this location. If you're using it as an example for running elsewhere, you may need to change or remove that.
To use the example environment file for kol-ci to get up and running with a new instance:
source kol-ci.env
openmrs-docker create kol-ci
openmrs-docker kol-ci initialize # Optional, but speeds up initial startup
openmrs-docker kol-ci start
openmrs-docker kol-ci wait # Tails logs until OpenMRS is ready, then exitsOnce created, day-to-day commands only need the instance name:
openmrs-docker kol-ci stop
openmrs-docker kol-ci logs
openmrs-docker kol-ci destroyCI is handled by GitHub Actions. On every push to main, the Build and deploy workflow:
- Builds and publishes the Maven artifact to Maven Central as
org.pih.openmrs:lesotho-distro. - Builds and pushes a multi-platform Docker image (amd64 + arm64) to Docker Hub at
partnersinhealth/lesotho-emr, tagged with bothlatestand the Maven project version.
A separate Build seeded images workflow runs nightly and publishes pre-initialized seed images to Docker Hub for kol-ci (partnersinhealth/lesotho-emr-seed-kol-ci).
A separate Update Versions workflow runs hourly and automatically commits any available snapshot dependency updates to main.