This fixed bugs introduced in edc9e030e1
(in https://github.com/apache/fineract/pull/648) which for FINERACT-773
actually broke things more instead of adding the intended feature, cauz:
1. FINERACT_DEFAULT_TENANTDB_HOSTNAME and FINERACT_DEFAULT_TENANTDB_PORT
were meant to be OS Environment Variables, not Java System properties
and so need to be read via System.getenv() not System.getProperty(),
duh!
2. The Travis CI test which was meant to ensure non-regression for this
broke in that same change, because the "|| docker logs" introduced at
the same time would always pass (EITHER because "http" passed OR
if not then "docker logs" would return 0), duh again!
Both were dumb, not sure what I was thinking when I had hacked this.. ;)
This PR also serves as a base solution for upcoming FINERACT-712 and
FINERACT-696. It includes using Objects.equals() to prevent NPEs, and
adding gradle check to run SpotBugs on Travis CI.
PS: SpotBugs is the successor to (and same code as) FindBugs.
In Docker, set JAVA_OPTS instead of FINERACT_TENANTS_URL.
Because ARG/ENV in the Dockerfile can't (easily) be changed at run-time.
At first I tried to override the ENTRYPOINT with a script which sets
JAVA_OPTS based on FINERACT_TENANTS_URL and then delegates to the original
/app-entrypoint.sh; that didn't immediately work, so this seems simpler.
Including make default tenant JDBC hostname & port configurable at Docker container run instead of build time.