From 3cf395da72243b0401474c96921eab475cfc222e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vorburger=20=E2=9B=91=EF=B8=8F?= Date: Thu, 13 Jun 2019 23:41:21 +0200 Subject: [PATCH 1/3] document how to run mysql in docker container in README --- README.md | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 9af02537e..07ce47c31 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,16 @@ Requirements * Java >= 1.8 (Oracle JVMs have been tested) * MySQL 5.5 +You can run the required version of the database server in a container, instead of having to install it, like this: + + docker run --name mysql-5.5 -p 3306:3306 -e MYSQL_ROOT_PASSWORD=mysql -d mysql:5.5 + +and stop and destroy it like this: + + docker rm -f myql-5.5 + +Beware that this database container database keeps its state inside the container and not on the host filesystem. It is lost when you destroy (rm) this container. This is typically fine for development. See [Caveats: Where to Store Data on the database container documentation](https://hub.docker.com/_/mysql) re. how to make it persistant instead of ephemeral. + Instructions to run Apache RAT (Release Audit Tool) ============ 1. Extract the archive file to your local directory. @@ -22,16 +32,15 @@ Instructions to build a war file Instructions to execute Integration tests ============ -1. Login to mysql DB using `mysql -u root -p mysql` > Note that if this is the first time to access MySQL DB, then you may need to reset your password. -2. Create the mifosplatform-tenants database using `CREATE DATABASE mifosplatform-tenants`. -3. Create the default tenant database using `CREATE DATABASE mifostenant-default`. -4. Download gradle-wrapper.jar version 2.10 and place it in the fineract-provider/gradle/wrapper folder. See 'Instructions to download gradle wrapper' above. -5. Run the following commands: - 1. `./gradlew migrateTenantListDB -PdbName=mifosplatform-tenants` - 2. `./gradlew migrateTenantDB -PdbName=mifostenant-default` -6. Run `./gradlew clean integrationTest` -7. Run `./gradlew tomcatRunWar` + +Run the following commands: +1. `./gradlew createDB -PdbName=mifosplatform-tenants` +1. `./gradlew createDB -PdbName=mifostenant-default` +1. `./gradlew migrateTenantListDB -PdbName=mifosplatform-tenants` +1. `./gradlew migrateTenantDB -PdbName=mifostenant-default` +1. `./gradlew clean integrationTest` +1. `./gradlew tomcatRunWar` Version ============ From fc7a5dd5fc6e0fe23288a93e27d388960c2fe6b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vorburger=20=E2=9B=91=EF=B8=8F?= Date: Thu, 13 Jun 2019 23:55:56 +0200 Subject: [PATCH 2/3] add link to .travis.yaml and fix typo in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 07ce47c31..d90259eae 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ You can run the required version of the database server in a container, instead and stop and destroy it like this: - docker rm -f myql-5.5 + docker rm -f mysql-5.5 Beware that this database container database keeps its state inside the container and not on the host filesystem. It is lost when you destroy (rm) this container. This is typically fine for development. See [Caveats: Where to Store Data on the database container documentation](https://hub.docker.com/_/mysql) re. how to make it persistant instead of ephemeral. @@ -34,7 +34,7 @@ Instructions to execute Integration tests ============ > Note that if this is the first time to access MySQL DB, then you may need to reset your password. -Run the following commands: +Run the following commands, very similarly to how [.travis.yml](.travis.yml) does: 1. `./gradlew createDB -PdbName=mifosplatform-tenants` 1. `./gradlew createDB -PdbName=mifostenant-default` 1. `./gradlew migrateTenantListDB -PdbName=mifosplatform-tenants` From 34e6a4f81e889ed5bac53733a9766afa1516cca2 Mon Sep 17 00:00:00 2001 From: "Michael Vorburger.ch" Date: Fri, 14 Jun 2019 01:29:10 +0200 Subject: [PATCH 3/3] fix ./gradlew createDB / dropDB / setBlankPassword --- fineract-provider/build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index f50be25bb..dee0cc30c 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -400,17 +400,17 @@ configurations.driver.each {File file -> task createDB<<{ description= "Creates the Database. Needs database name to be passed (like: -PdbName=someDBname)" - sql = Sql.newInstance( 'jdbc:mysql:thin://localhost:3306/', mysqlUser, mysqlPassword, 'org.drizzle.jdbc.DrizzleDriver' ) + def sql = Sql.newInstance( 'jdbc:mysql:thin://localhost:3306/', mysqlUser, mysqlPassword, 'org.drizzle.jdbc.DrizzleDriver' ) sql.execute( 'create database '+"`$dbName`" ) } task dropDB<<{ description= "Drops the specified database. The database name has to be passed (like: -PdbName=someDBname)" - sql = Sql.newInstance( 'jdbc:mysql:thin://localhost:3306/', mysqlUser, mysqlPassword, 'org.drizzle.jdbc.DrizzleDriver' ) + def sql = Sql.newInstance( 'jdbc:mysql:thin://localhost:3306/', mysqlUser, mysqlPassword, 'org.drizzle.jdbc.DrizzleDriver' ) sql.execute( 'DROP DATABASE '+"`$dbName`") } task setBlankPassword<<{ - sql = Sql.newInstance( 'jdbc:mysql:thin://localhost:3306/', mysqlUser, mysqlPassword, 'org.drizzle.jdbc.DrizzleDriver' ) + def sql = Sql.newInstance( 'jdbc:mysql:thin://localhost:3306/', mysqlUser, mysqlPassword, 'org.drizzle.jdbc.DrizzleDriver' ) sql.execute('USE `mifosplatform-tenants`') sql.execute('UPDATE mifosplatform-tenants.tenants SET schema_server = \'localhost\', schema_server_port = \'3306\', schema_username = \'mifos\', schema_password = \'mysql\' WHERE id=1;') }