This represents the overall distribution and customization module for PIH Malawi
NOTE The following are variables which can be modified:
serverId = malawi
database = openmrs_neno
source code = ~/workspace
module name = pihmalawi for openmrs-module-pihmalawi
- Install Java and Maven
- Install git
- sudo apt-get install git
- To setup the OpenMRS SDK, you just need to open up a terminal/console and enter:
- mvn org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:setup-sdk
- Edit MySQL server config file
- On Mac OS, the config file is located at /etc/my.cnf:
default-time-zone=-4:00
- On Ubuntu
default-time-zone=”America/New_York"
- I think in Malawi the GMT offset is +2:00?
- Restart mysql server
- Log on mysql server and check the time zone:
mysql -u root -p SELECT @@global.time_zone;
- It should display something like:
+--------------------+ | @@global.time_zone | +--------------------+ | -04:00 | +--------------------+
Download a de-identified backup and source the database:
mysql -u root -p mysql
(enter password)
CREATE DATABASE openmrs_neno DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
GRANT ALL ON `openmrs_neno`.* TO 'openmrs'@'localhost' IDENTIFIED BY 'openmrs';
use openmrs_neno;
source *name of openmrs neno database*.sql
-
Setup source code directory
- cd ~
- mkdir workspace
- cd workspace
-
Get PIH Malawi module from git
- git clone https://github.com/PIH/openmrs-module-pihmalawi.git pihmalawi
-
Install the PIH Malawi omod in your local maven repo
- from the directory you have PIH Malawi checked out build the pihmalawi distribution:
mvn clean install -DskipTests -Pdistribution
-
Setup SDK
- mvn openmrs-sdk:setup -DserverId=malawi
- Type '1' to setup a distribution
- Set custom distribution = 'org.openmrs.distro:pihmalawi:X-Y-Z-SNAPSHOT' (see pom.xml for current version)
- Set -DdbUri=jdbc:mysql://localhost:3306/openmrs_neno
- or, just run the following command
mvn openmrs-sdk:setup -DserverId=malawi -Ddistro=org.openmrs.distro:pihmalawi:7.0.0-SNAPSHOT -DdbUri=jdbc:mysql://localhost:3306/openmrs_neno -DdbUser=openmrs -DdbPassword=openmrs
-
Install configuration
- cd configuration
- ./install.sh (eg. ./install.sh malawi)
-
Run SDK
- mvn openmrs-sdk:run -DserverId=malawi
With the Chrome browser, use this URL:
If you want to modify and test the PIH Malawi module, you can "watch" the the module for the "malawi" project. You can add a module as watched by the selected server executing the openmrs-sdk:watch command in module's project directory.
cd ~/workspace/pihmalawi
mvn openmrs-sdk:watch -DserverId=malawi
mvn openmrs-sdk:run -DserverId=malawi
- Update pihmalawi code to latest from git
- Update all (5) poms to the version you want to release (eg. change 7.0.0-SNAPSHOT to 7.0.0)
- Build locally and confirm it builds and all of the artifacts have a version of 7.0.0
- Commit and push
- Here, you let the CI job run. It will build and deploy, and because this is not a snapshot, it will go to the releases maven repository)
- Once that has successfully finished, go back into the code and:
- Git pull
- Create a tag reflecting that this is the release version (eg. tag as 7.0.0)
- Update all (5) poms to the next snapshot version you want to use (eg. change 7.0.0 to 7.1.0-SNAPSHOT)
- Build locally and confirm it builds and all of the artifacts have the right new snapshot version
- Commit and push
Make sure no one is going to commit any code to the repo while you are in the middle of this process, as we don’t want any changes getting committed while the version is set to a non-snapshot version.