Skip to content

Commit

Permalink
remove createDB/dropDB stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
kjozsa committed Oct 7, 2024
1 parent 3813fcb commit e2fc058
Showing 1 changed file with 3 additions and 58 deletions.
61 changes: 3 additions & 58 deletions fineract-provider/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ description = 'Fineract Provider'

apply plugin: 'java'
apply plugin: 'org.springframework.boot'
//apply plugin: 'com.gorylenko.gradle-git-properties'
apply plugin: 'io.swagger.core.v3.swagger-gradle-plugin'
apply plugin: 'com.google.cloud.tools.jib'
apply plugin: 'se.thinkcode.cucumber-runner'
Expand All @@ -42,7 +41,7 @@ compileJava.doLast {
delete "${source}/META-INF/persistence.xml"
}

task prepareInputYaml {
tasks.register('prepareInputYaml') {
inputs.file('config/swagger/fineract-input.yaml.template')
outputs.file("$buildDir/tmp/swagger/fineract-input.yaml")
doLast {
Expand Down Expand Up @@ -113,59 +112,8 @@ sourceSets {

import groovy.sql.Sql

ext {
mysqlUser = 'root'
mysqlPassword = 'mysql'
pgUser = 'root'
pgPassword = 'postgres'
}

tasks.register('createDB') {
description = 'Creates the MariaDB Database. Needs database name to be passed (e.g., -PdbName=someDBname)'
doLast {
def sql = Sql.newInstance('jdbc:mariadb://localhost:3306/', mysqlUser, mysqlPassword, 'org.mariadb.jdbc.Driver')
sql.execute("CREATE DATABASE `${dbName}` CHARACTER SET utf8mb4")
}
}

tasks.register('dropDB') {
description = 'Drops the specified MariaDB database. Needs database name to be passed (e.g., -PdbName=someDBname)'
doLast {
def sql = Sql.newInstance('jdbc:mariadb://localhost:3306/', mysqlUser, mysqlPassword, 'org.mariadb.jdbc.Driver')
sql.execute("DROP DATABASE `${dbName}`")
}
}

tasks.register('createPGDB') {
description = 'Creates the PostgreSQL Database. Needs database name to be passed (e.g., -PdbName=someDBname)'
doLast {
def sql = Sql.newInstance('jdbc:postgresql://localhost:5432/', pgUser, pgPassword, 'org.postgresql.Driver')
sql.execute("CREATE DATABASE ${dbName}")
}
}

tasks.register('dropPGDB') {
description = 'Drops the specified PostgreSQL database. Needs database name to be passed (e.g., -PdbName=someDBname)'
doLast {
def sql = Sql.newInstance('jdbc:postgresql://localhost:5432/', pgUser, pgPassword, 'org.postgresql.Driver')
sql.execute("DROP DATABASE ${dbName}")
}
}

tasks.register('createMySQLDB') {
description = 'Creates the MySQL Database. Needs database name to be passed (e.g., -PdbName=someDBname)'
doLast {
def sql = Sql.newInstance('jdbc:mysql://localhost:3306/', mysqlUser, mysqlPassword, 'com.mysql.cj.jdbc.Driver')
sql.execute("CREATE DATABASE `${dbName}` CHARACTER SET utf8mb4")
}
}

tasks.register('dropMySQLDB') {
description = 'Drops the specified MySQL database. Needs database name to be passed (e.g., -PdbName=someDBname)'
doLast {
def sql = Sql.newInstance('jdbc:mysql://localhost:3306/', mysqlUser, mysqlPassword, 'com.mysql.cj.jdbc.Driver')
sql.execute("DROP DATABASE `${dbName}`")
}
springBoot {
mainClass = 'org.apache.fineract.ServerApplication'
}

bootRun {
Expand All @@ -174,9 +122,6 @@ bootRun {
]
}

springBoot {
mainClass = 'org.apache.fineract.ServerApplication'
}

bootJar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
Expand Down

0 comments on commit e2fc058

Please sign in to comment.