add sensible defaults to db wrapper tasks.

This commit is contained in:
Keith Woodlock
2013-04-04 12:30:48 +01:00
parent af79fd0790
commit da12288024
+34 -16
View File
@@ -308,21 +308,31 @@ flyway {
} }
task migrateTenantDB<<{ task migrateTenantDB<<{
description="Migrates a Tenant DB. Have to pass dbName. (Example: -PdbName=someTenantDBname). " description="Migrates a Tenant DB. Optionally can pass dbName. Defaults to 'mifostenant-default' (Example: -PdbName=someTenantDBname)"
flyway.url= "jdbc:mysql://localhost:3306/$dbName" def tenantDbName = 'mifostenant-default';
if (rootProject.hasProperty("dbName")) {
tenantDbName = rootProject.getProperty("dbName")
}
flyway.url= "jdbc:mysql://localhost:3306/$tenantDbName"
flyway.locations= [ flyway.locations= [
"filesystem:../mifosng-db/migrations/core_db", "filesystem:../mifosng-db/migrations/core_db",
] ]
flywayMigrate.execute() flywayMigrate.execute()
} }
task showTenantDBInfo<<{ task showTenantDBInfo<<{
description="Shows the migration info for a Tenant DB. Have to pass dbName. (Example: -PdbName=someTenantDBname)" description="Shows the migration info for a Tenant DB. Optionally can pass dbName. Defaults to 'mifostenant-default' (Example: -PdbName=someTenantDBname)"
flyway.url= "jdbc:mysql://localhost:3306/$dbName"
def tenantDbName = 'mifostenant-default';
if (rootProject.hasProperty("dbName")) {
tenantDbName = rootProject.getProperty("dbName")
}
flyway.url= "jdbc:mysql://localhost:3306/$tenantDbName"
flyway.locations= [ flyway.locations= [
"filesystem:../mifosng-db/migrations/core_db", "filesystem:../mifosng-db/migrations/core_db",
] ]
@@ -331,9 +341,14 @@ task showTenantDBInfo<<{
task migrateTenantListDB<<{ task migrateTenantListDB<<{
description="Migrates a Tenant List DB. Have to pass dbName. (Example: -PdbName=someDBname)" description="Migrates a Tenant List DB. Optionally can pass dbName. Defaults to 'mifosplatform-tenants' (Example: -PdbName=someDBname)"
flyway.url= "jdbc:mysql://localhost:3306/$dbName" def tenantsDbName = 'mifosplatform-tenants';
if (rootProject.hasProperty("dbName")) {
tenantsDbName = rootProject.getProperty("dbName")
}
flyway.url= "jdbc:mysql://localhost:3306/$tenantsDbName"
flyway.locations= [ flyway.locations= [
"filesystem:../mifosng-db/migrations/list_db", "filesystem:../mifosng-db/migrations/list_db",
] ]
@@ -341,17 +356,21 @@ task migrateTenantListDB<<{
flywayMigrate.execute() flywayMigrate.execute()
} }
task showTenentListDBInfo<<{ task showTenantListDBInfo<<{
description="Shows the migration info for a List DB. Have to pass dbName. (Example: -PdbName=someDBname)" description="Shows the migration info for a List DB. Optionally can pass dbName. Defaults to 'mifosplatform-tenants' (Example: -PdbName=someDBname)"
flyway.url= "jdbc:mysql://localhost:3306/$dbName"
def tenantsDbName = 'mifosplatform-tenants';
if (rootProject.hasProperty("dbName")) {
tenantsDbName = rootProject.getProperty("dbName")
}
flyway.url= "jdbc:mysql://localhost:3306/$tenantsDbName"
flyway.locations= [ flyway.locations= [
"filesystem:../mifosng-db/migrations/list_db", "filesystem:../mifosng-db/migrations/list_db",
] ]
flywayInfo.execute() flywayInfo.execute()
} }
/* /*
* Support publication of artifacts versioned by topic branch. * Support publication of artifacts versioned by topic branch.
* CI builds supply `-P BRANCH_NAME=<TOPIC>` to gradle at build time. * CI builds supply `-P BRANCH_NAME=<TOPIC>` to gradle at build time.
@@ -368,5 +387,4 @@ def qualifyVersionIfNecessary(version) {
} }
} }
return version return version
} }