Install docker - Step 1 is enough
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04
Docker Installation + Subnet+Hosts
sudo docker network create --subnet=172.18.0.0/16 dbmc-net
Add the following machine name in hosts file
Location - /etc/hosts Note - in Landing machine not in docker
What to add?
- 172.18.0.5 dbmc-mysql-node
172.18.0.2 dbmc-appserver-node
172.18.0.6 dbmc-webserver-node
Mysql Instructions :
Pull ubuntu image from docker hub
docker pull ubuntu
Setting data folder for storing mysql data in docker
sudo su
mkdir -p /mariadb/
Creating MySQL container with data folder and container name
Command -
sudo docker run -it -h dbmc-mysql-node --ip 172.18.0.5 --add-host dbmc-appserver-node:172.18.0.2
--add-host dbmc-webserver-node:172.18.0.6 -p 0.0.0.0:3306:9377 --net dbmc-net -v mariadb/:/var/lib/mysql --name database -e MYSQL_ROOT_PASSWORD=password -d ubuntu
- sudo docker exec -it container name /bin/bash
Install mariadb inside the docker container
Refer this link for more Reference if you want:
Link - https://github.com/jpvelsamy/incubator-fineract
Tomcat Instructions :
Cloned tomcat server source from bitbucket
or
Just download apache tomcat.zip file from official site
https://sid98@bitbucket.org/lasalleadmin/tomcat.git
Build docker images from that repository
How to do?
Location - /home/sid/software/tomcat/7/jre8
Command - sudo docker build -t dbmc/tomcat:7.0.75 . or dbmc/tomcat:7.0.76
Then run the tomcat instance in docker
How to do?
Command -
Run ./gradlew rat. Report will be generated under /build/reports/rat/rat-report.txt
If there is an error while building rat file or war file then run the follwing command.
Command - ./gradlew tasks licenseFormatMain licenseFormatTest licenseFormatIntegrationTest
Instructions to build war file
Run ./gradlew clean war or ./gradlew build to build deployable war file which will be
created at build/libs directory.
Instructions to execute Integration tests
Login to mysql DB using mysql -u root -pmysql
Create the mifosplatform-tenants database using `CREATE DATABASE mifosplatform- tenants`.
Create the default tenant database using `CREATE DATABASE mifostenant-default`.
Download gradle-wrapper.jar version 2.10 and place it in the fineract- provider/gradle/wrapper folder.
Run the following commands:
./gradlew migrateTenantListDB -PdbName=mifosplatform-tenants
UPDATE tenant_server_connections SET schema_server='dbmc-mysql-node', schema_password='password' WHERE schema_name='mifostenant-default';
./gradlew migrateTenantDB -PdbName=mifostenant-default
Run ./gradlew clean integrationTest (may not run but that's not an issue)
Once the key is imported and the repository added you can install MariaDB with:
Login into mysql using mysql -u root -ppassword
Create two databases
Query - CREATE DATABASE `mifosplatform-tenants`
CREATE DATABASE `mifostenant-default`
Fineract Instructions :
Clone the incubator-fineract repository from your bitbucket account.
https://sid98@bitbucket.org/lasalleadmin/incubator-fineract.git
Checkout the repository from develop to apple branch.
Command - git checkout apple
Change the build.gradle file.
Location - home/(Your username)/workspace/incubator-fineract/fineract- provider/build.gradle
What to change ?
project.ext.mysqlUser='your mysql username'
project.ext.mysqlPassword='your mysql password'
For Host - flyway.url= "jdbc:mysql:thin://localhost:3306/$tenantDbName"
For Docker - flyway.url= "jdbc:mysql:thin://dbmc-mysql-node:3306/$tenantDbName"
You have to change all the values in the build.gradle regarding the jdbc URL
Instructions to run Apache RAT (Release Audit Tool)
sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://sgp1.mirrors.digitalocean.com/mariadb/repo/10.2/ubuntu xenial main'
sudo apt update sudo apt install mariadb-server
sudo docker run -it -h dbmc-appserver-node --ip 172.18.0.2 --add-host dbmc-mysql-node:172.18.0.5 --add-host dbmc-webserver-node:172.18.0.6 --net dbmc-net -p 0.0.0.0:8080:8080 -p 0.0.0.0:443:8443 -d --name appserver appserver
- sudo docker exec -it container name /bin/bash
Create RSA key and store it in a file .
How to do?
sudo keytool -genkey -keyalg RSA -alias tomcat -keystore /usr/local/tomcat/tomcat.keystore
set password to: xyz123
Changed the server.xml file.
Location - /usr/local/tomcat/conf/server.xml
What to Change?
url="jdbc:mysql:thin://dbmc-mysql-node:3306/mifosplatform-tenants"
username="your mysql username"
password="your mysql password"
keystoreFile="/usr/local/tomcat/tomcat.keystore" .
Dowload drizzle jdbc driver
Link - wget http://central.maven.org/maven2/org/drizzle/jdbc/
drizzle-jdbc/1.3/drizzle-jdbc-1.3.jar
Location : /usr/local/tomcat/libs
Copy the fineract-provider.war file from local machine to docker machine
How to copy
Sudo docker cp /home/username/workspace/mifos/incubator-fineract/fineract-provider/build/libs/fineract-provider.war tomcat:/usr/local/tomcat/webapps
Location :
From - /home/sid/workspace/mifos-myfork/incubator-fineract
/fineract-provider/build/libs/fineract-provider.war
To - tomcat:/usr/local/tomcat/webapps/fineract-provider.war
Start the tomcat server
Location - /usr/local/tomcat/bin
Command
To start the server - ./startup.sh
To stop the server - ./shoutdown.sh
To check the log - tail -100f ../logs/catalina.out
To delete logs and texts - rm -rf /usr/local/tomcat/logs/catalina.out;
rm -rf /usr/local/tomcat/log/*.log;
rm -rf /usr/local/tomcat/logs/*.txt
Mifos Instructions :
Clone Node docker image from docker hub
docker pull node:7.7.1
Clone the Community-app from your bitbucket account
Refer this link to complete the remaining setup:
Link - https://sid98@bitbucket.org/lasalleadmin/community-app.git
Checkout the repository from develop to apple branch.
Command - git checkout apple
Change the Initialtasks.js and gruntfile.js in community-app .
Location:
Initialtasks.js - /home/sid(your username)/workspace/mifos-myfork
/community-app/app/scripts/initialtasks.js
What to change?
baseApiUrl = "https://localhost/fineract-provider/api/v1? tenantIdentifier=default"
Gruntfile.js - /home/sid/workspace/mifos-myfork/community-app/Gruntfile.js
What to change?
Hostname = '0.0.0.0'
Location - /home/node/community-app
Commands - sudo apt-get install nodejs-legacy
npm config set prefix ~
npm install -g bower
npm install -g grunt-cli
~/bin/bower install
npm install
Then start the grunt server
Commands - ~/bin/grunt serve or /home/username/bin/grunt serve
After i finished the setup i started the server and i wasn't able to login because of the fineract certification problem. To resolve this i had to do the following things
Go to this adress - https://localhost/fineract-provider and it will show certification error in your browser, so u have to add this address as an exception in your browser.
Then run the index.html page
Location - /home/sid/workspace/mifos-myfork/community- app/app/index.html
(or)
Http://localhost
sudo docker run -it -h dbmc-webserver-node --ip 172.18.0.6 --add-host dbmc-mysql-node:172.18.0.5 --add-host dbmc-appserver-node:172.18.0.2 --net dbmc-net -p 0.0.0.0:80:9000 -d --name webserver webserver