
plugins {
    id 'org.liquibase.gradle' version '2.1.1'
}

repositories {
    mavenCentral()
}

def db_host = System.getenv("DB_HOST") ?: "localhost"
def db_port = System.getenv("DB_PORT") ?: "3307" // We launch Cloud SQL Proxy on this port.
def liquibase_password = System.getenv("LIQUIBASE_DB_PASSWORD") ?: "lb-notasecret"

dependencies {
    liquibaseRuntime 'org.liquibase:liquibase-core:4.31.1'
    liquibaseRuntime 'org.liquibase:liquibase-groovy-dsl:4.0.0'
    liquibaseRuntime 'info.picocli:picocli:4.7.6'
    liquibaseRuntime 'com.mysql:mysql-connector-j:9.3.0'
    liquibaseRuntime 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.2'
    liquibaseRuntime 'org.glassfish.jaxb:jaxb-runtime:4.0.5'
}

liquibase {
    activities {
        main {
            changeLogFile "changelog/db.changelog-master.xml"
            url "jdbc:mysql://${db_host}:${db_port}/workbench"
            username "liquibase"
            password "${liquibase_password}"
            classpath "$rootDir"
            showBanner false
        }
        runList = project.ext.runList
    }
}
