Merge pull request #613 from vorburger/FINERACT-765_rm-flyway-from-gradle
remove Flyway completely from Gradle build (fixes FINERACT-765)
This commit is contained in:
@@ -26,7 +26,6 @@ RUN mkdir fineract
|
||||
COPY . fineract
|
||||
|
||||
WORKDIR fineract
|
||||
RUN sed -i 's/localhost/fineractmysql/' ./fineract-provider/build.gradle
|
||||
RUN sed -i 's/localhost/fineractmysql/' ./fineract-provider/src/main/resources/sql/migrations/list_db/V1__mifos-platform-shared-tenants.sql
|
||||
RUN ./gradlew clean war
|
||||
RUN mv build/libs/fineract-provider.war /opt/bitnami/tomcat/webapps
|
||||
|
||||
@@ -415,117 +415,6 @@ task setBlankPassword<<{
|
||||
}
|
||||
|
||||
|
||||
apply plugin: 'flyway'
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath "org.flywaydb:flyway-gradle-plugin:3.0" // version upgraded during Spring Boot & MariaDB4j work, as prev. used v0.2 didn't work well after *.sql moved from fineract-db to fineract-provider/src/main/resources (new version also has clearer errors, e.g. in case of missing DB)
|
||||
|
||||
// NOT classpath 'org.drizzle.jdbc:drizzle-jdbc:1.3' as it is not compatible with Flyway 3.1+ (only up to 3.0)
|
||||
// We require Flyway 3.1+ because =< 3.0 is not compatible with current Gradle versions (only ancient ones we originally used to use).
|
||||
// Using LGPL ConnectorJ ()org.mariadb.jdbc:mariadb-java-client) instead of the BSD licensed drizzle-jdbc *IS OK* at Apache.org,
|
||||
// as long as it's only used as a test library by developers at build time, and not end-user distributed, and optional.
|
||||
// So it's OK here, but would not be as a default runtime dependency and in the dist JAR/WAR.
|
||||
// see https://issues.apache.org/jira/browse/LEGAL-462
|
||||
// see https://issues.apache.org/jira/browse/FINERACT-761
|
||||
// see https://github.com/flyway/flyway/issues/2332
|
||||
// see https://github.com/krummas/DrizzleJDBC/issues/46
|
||||
// see https://github.com/apache/fineract/pull/525
|
||||
// see https://github.com/apache/fineract/pull/550
|
||||
classpath 'org.mariadb.jdbc:mariadb-java-client:2.4.1'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
flyway {
|
||||
url = "jdbc:mariadb://localhost:3306/mifostenant-default"
|
||||
driver = "org.mariadb.jdbc.Driver"
|
||||
user = mysqlUser
|
||||
password = mysqlPassword
|
||||
}
|
||||
|
||||
task migrateTenantDB<<{
|
||||
description="Migrates a Tenant DB. Optionally can pass dbName. Defaults to 'mifostenant-default' (Example: -PdbName=someTenantDBname)"
|
||||
|
||||
def filePath = "filesystem:$projectDir" + '/src/main/resources/sql/migrations/core_db'
|
||||
def tenantDbName = 'mifostenant-default';
|
||||
if (rootProject.hasProperty("dbName")) {
|
||||
tenantDbName = rootProject.getProperty("dbName")
|
||||
}
|
||||
|
||||
flyway.url= "jdbc:mariadb://localhost:3306/$tenantDbName"
|
||||
flyway.driver = "org.mariadb.jdbc.Driver"
|
||||
flyway.locations= [filePath]
|
||||
/**We use ${ as the prefix for strecthy reporting, do not want them to be interpreted by Flyway**/
|
||||
flyway.placeholderPrefix = "\$\${"
|
||||
flywayMigrate.execute()
|
||||
}
|
||||
|
||||
task showTenantDBInfo<<{
|
||||
description="Shows the migration info for a Tenant DB. Optionally can pass dbName. Defaults to 'mifostenant-default' (Example: -PdbName=someTenantDBname)"
|
||||
|
||||
def filePath = "filesystem:$projectDir" + '/src/main/resources/sql/migrations/core_db'
|
||||
def tenantDbName = 'mifostenant-default';
|
||||
if (rootProject.hasProperty("dbName")) {
|
||||
tenantDbName = rootProject.getProperty("dbName")
|
||||
}
|
||||
|
||||
flyway.url= "jdbc:mariadb://localhost:3306/$tenantDbName"
|
||||
flyway.driver = "org.mariadb.jdbc.Driver"
|
||||
flyway.locations= [filePath]
|
||||
flywayInfo.execute()
|
||||
}
|
||||
|
||||
|
||||
task migrateTenantListDB<<{
|
||||
description="Migrates a Tenant List DB. Optionally can pass dbName. Defaults to 'mifosplatform-tenants' (Example: -PdbName=someDBname)"
|
||||
|
||||
def filePath = "filesystem:$projectDir" + '/src/main/resources/sql/migrations/list_db'
|
||||
def tenantsDbName = 'mifosplatform-tenants';
|
||||
if (rootProject.hasProperty("dbName")) {
|
||||
tenantsDbName = rootProject.getProperty("dbName")
|
||||
}
|
||||
|
||||
flyway.url= "jdbc:mariadb://localhost:3306/$tenantsDbName"
|
||||
flyway.driver = "org.mariadb.jdbc.Driver"
|
||||
flyway.locations= [filePath]
|
||||
|
||||
flywayMigrate.execute()
|
||||
}
|
||||
|
||||
task showTenantListDBInfo<<{
|
||||
description="Shows the migration info for a List DB. Optionally can pass dbName. Defaults to 'mifosplatform-tenants' (Example: -PdbName=someDBname)"
|
||||
|
||||
def filePath = "filesystem:$projectDir" + '/src/main/resources/sql/migrations/list_db'
|
||||
def tenantsDbName = 'mifosplatform-tenants';
|
||||
if (rootProject.hasProperty("dbName")) {
|
||||
tenantsDbName = rootProject.getProperty("dbName")
|
||||
}
|
||||
|
||||
flyway.url= "jdbc:mariadb://localhost:3306/$tenantsDbName"
|
||||
flyway.driver = "org.mariadb.jdbc.Driver"
|
||||
flyway.locations= [filePath]
|
||||
flywayInfo.execute()
|
||||
}
|
||||
|
||||
task repairTenantDB<<{
|
||||
description="repair migrate"
|
||||
|
||||
def filePath = "filesystem:$projectDir" + '/src/main/resources/sql/migrations/list_db'
|
||||
def tenantsDbName = 'mifosplatform-tenants';
|
||||
if (rootProject.hasProperty("dbName")) {
|
||||
tenantsDbName = rootProject.getProperty("dbName")
|
||||
}
|
||||
|
||||
flyway.url= "jdbc:mariadb://localhost:3306/$tenantsDbName"
|
||||
flyway.driver = "org.mariadb.jdbc.Driver"
|
||||
flyway.locations= [filePath]
|
||||
flywayRepair.execute()
|
||||
}
|
||||
|
||||
/*
|
||||
* Support publication of artifacts versioned by topic branch.
|
||||
* CI builds supply `-P BRANCH_NAME=<TOPIC>` to gradle at build time.
|
||||
|
||||
Reference in New Issue
Block a user