From 929b6ce2f7d67b7c9e2d0ed6ed7fd1f9b73accee Mon Sep 17 00:00:00 2001 From: Justin Field Date: Sun, 11 Dec 2016 14:31:10 -0800 Subject: [PATCH] Configure fly plugin to load props from local-overrides so that developers can clean the db and do other stuff --- build.gradle | 15 +++++++++++++++ gradle/buildscript.gradle | 1 + 2 files changed, 16 insertions(+) diff --git a/build.gradle b/build.gradle index e8f7a8c68..b552283e0 100644 --- a/build.gradle +++ b/build.gradle @@ -14,6 +14,8 @@ * limitations under the License. */ +import com.typesafe.config.ConfigFactory + buildscript { apply from: file('gradle/buildscript.gradle'), to: buildscript } @@ -107,4 +109,17 @@ jar { 'Main-Class': 'com.nike.cerberus.Main' ) } +} + +def config = ConfigFactory.parseFile(new File("${project.getRootDir().absolutePath}${File.separator}src${File.separator}main${File.separator}resources${File.separator}cms-local-overrides.conf")) + +project.ext { + flyway.user = config.getString('JDBC.username') + flyway.password = config.getString('JDBC.password') + flyway.url = config.getString('JDBC.url') +} + +flyway { + schemas = ["cms"] + locations = ["classpath:com/nike/cerberus/migration"] } \ No newline at end of file diff --git a/gradle/buildscript.gradle b/gradle/buildscript.gradle index d67f23c72..eadc28bd1 100644 --- a/gradle/buildscript.gradle +++ b/gradle/buildscript.gradle @@ -23,4 +23,5 @@ dependencies { classpath "net.saliman:gradle-cobertura-plugin:2.3.2" classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.6.3' classpath 'com.github.ksoichiro:gradle-console-reporter:0.4.0' + classpath group: 'com.typesafe', name: 'config', version: '1.3.1' } \ No newline at end of file