Managing Server Wide Properties

Managing server wide properties can be a problem after splitting the repositories. Some properties are shared by different modules and duplicating these properties may cause the deployment tasks to be tedious and confusing. Ideally, the properties files should be in one place where they can be referenced and/or changed.

To solve this issue we created a configs repository that will have server wide properties opensrp-server-configs. Updates to this repository should be done via Pull Requests just like the other repositories.

Git Submodules

Submodules allow you to add another repository as a dependency to your repository. This is done by adding it as a sub directory allowing you to clone another repository into your project and keep your commits separate.

To add opensrp-server-configs as a submodule to opensrp-server-core repository, there following command was used

git submodule add -b master https://github.com/OpenSRP/opensrp-server-configs configs

NB: -b specifies the branch to clone.

Then to update the submodule

git submodule update --remote

Any updates to the submodule should be committed and pushed in your repository since the submodule is tracked using the latest commit hash

If you are cloning an existing repo you need to setup the submodule by running the following command

git submodule update --init --recursive

Then make sure the submodule points to the latest commit in the master branch

The configs submodule for opensrp-server-core repository is tracked using the latest commit 5c25350

Repositories that use configs submodule

Modules

https://github.com/OpenSRP/opensrp-server-core

https://github.com/OpenSRP/opensrp-server-form

https://github.com/OpenSRP/opensrp-server-connector

https://github.com/OpenSRP/opensrp-server-reporting

https://github.com/OpenSRP/opensrp-server-register


Web applications

https://github.com/OpenSRP/opensrp-server-web

References

https://blog.github.com/2016-02-01-working-with-submodules

https://stackoverflow.com/questions/19619747/git-submodule-update-remote-vs-git-pull

https://git-scm.com/book/en/v2/Git-Tools-Submodules