Setup Instructions

The OpenSRP platform includes three components OpenSRP Android Client, OpenSRP Server and OpenMRS. Each of these systems have a distinct development environment. This section includes setup instructions for each component of OpenSRP. Generally speaking, the setup involves using package managers as displayed below:

For Mac OS X 10.9.2 and later, make sure that Homebrew is installed, and use brew install [pkg]. To install a specific version of the [pkg], use brew install [pkg] --version[version]

For Ubuntu/Debian use sudo apt-get install [pkg]

For Red Hat/Fedora/CentOS use sudo yum install [pkg]
 

Development Environment Setup

The OpenSRP Client development environment setup instructions can be found in the OpenSRP App Build document
The OpenSRP Server development environment setup instructions can be found in the OpenSRP Server Build document
The OpenMRS environment setup instructions can be found in the OpenMRS Server Configuration document

Docker Environment

We have created Docker environments for the OpenSRP Server and OpenMRS systems that allow you to quickly stand up a server for development and testing. Please note that these docker environments come pre-installed with forms, fields and variables. Your implementation will likely have to modify these across all three components.

Ansible Playbooks

Ansible Playbooks are currently offline

As of 5 Feb 2018 the team is actively working on the Ansible Playbooks and have made the repository private. We will update this post when the Playbooks are back online.

Easily manage (deploy new instances of or update) your OpenSRP, OpenMRS, and DHIS2 setups using the Ansible Playbooks provided here. The repository uses Ansible's recommended alternative directory layout. You will need to create host_vars and group_vars to match your setup, if you haven't already.

For local "dev" deployments, you will need to install Virtualbox. You'll need the vault password used to encrypt sensitive info in this repo.

Make sure all pip requirements are installed by running the following command. We recommend you do this in a dedicated Python virtual env:

pip install -r requirements.txt

If you install your pip requirements in a Python virtual env, activate them using. You will need to do this before running any of the playbooks:

workon [name of the virtual env]

Here is a list of Ansible options you might want to add when running a playbook:

OptionDescription
-e "certbot_create_certs=true"Force the playbook to generate a new LetsEncrypt certificate and key. Only applies for sites that have been set to use LetsEncrypt certs.

OpenSRP

Run the following command to start the OpenSRP playbook in your production environment:

ansible-playbook -i inventories/production deploy-opensrp.yaml --vault-password-file=[local path to the file holding the vault password] --limit [name of the host or group you'd like to deploy to]

Switch the inventory to inventories/staging to run the playbook in your staging environment.

The playbook only packages an OpenSRP WAR file if it doesn't exist in your deployment machine's WAR directory (default is /tmp/opensrp-wars). You will need to delete the WAR file from this directory if you want the playbooks to repackage the project.

OpenMRS

Run the following command to start the OpenMRS playbook in your production environment:

ansible-playbook -i inventories/production deploy-openmrs.yaml --vault-password-file=[local path to the file holding the vault password] --limit [name of the host or group you'd like to deploy to]

Switch the inventory to inventories/staging to run the playbook in your staging environment.

DHIS 2

Run the following command to start the DHIS playbook in your production environment:

ansible-playbook -i inventories/production deploy-dhis.yaml --vault-password-file=[local path to the file holding the vault password] --limit [name of the host or group you'd like to deploy to]

Switch the inventory to inventories/staging to run the playbook in your staging environment.