Skip to content

Instantly share code, notes, and snippets.

@der3k
Created December 21, 2015 17:03
Show Gist options
  • Save der3k/4e79c3f26bdb4939fb58 to your computer and use it in GitHub Desktop.
Save der3k/4e79c3f26bdb4939fb58 to your computer and use it in GitHub Desktop.
Flyway Gradle build
plugins {
id 'java'
id 'org.flywaydb.flyway' version '3.2'
}
repositories {
mavenCentral()
}
dependencies {
compile 'postgresql:postgresql:9.1-901.jdbc4'
}
flyway {
url = System.getenv()['SIS_JDBC_URL']
user = System.getenv()['SIS_JDBC_USER']
password = System.getenv()['SIS_JDBC_PASSWORD']
sqlMigrationPrefix = 'v'
locations = ['filesystem:src/main/resources/db/migrations']
if (project.hasProperty('env') && env == 'test') {
locations += 'filesystem:src/test/resources/db/migrations'
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.4'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment