diff --git a/build.gradle.kts b/build.gradle.kts index f991b58..4cf6039 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -113,14 +113,14 @@ jib { } } -flyway { - url = env.MYSQL_URL.value + "?permitMysqlScheme=true" - user = env.MYSQL_USERNAME.value - password = env.MYSQL_PASSWORD.value - locations = arrayOf("classpath:db/migration") - driver = "com.mysql.cj.jdbc.Driver" -} - tasks.withType { + enabled = env.isPresent("MYSQL_URL") + dependsOn("classes") + + url = env.fetchOrNull("MYSQL_URL") + user = env.fetchOrNull("MYSQL_USERNAME") + password = env.fetchOrNull("MYSQL_PASSWORD") + locations = arrayOf("classpath:db/migration") + driver = "com.mysql.cj.jdbc.Driver" }