Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using flyway 2.1.1 #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repositories {

dependencies {
compile gradleApi()
compile "com.googlecode.flyway:flyway-core:1.7"
compile "com.googlecode.flyway:flyway-core:2.1.1"

groovy localGroovy()

Expand Down
47 changes: 47 additions & 0 deletions mv-build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
apply plugin: 'idea'
apply plugin: 'maven'
apply plugin: 'groovy'
apply from: "https://launchpad.net/gradle-release/trunk/latest/+download/apply.groovy"

repositories {
mavenCentral()
}

dependencies {
compile gradleApi()
compile "com.googlecode.flyway:flyway-core:2.1.1"

groovy localGroovy()

testCompile "com.h2database:h2:1.3.160"
}


if (project.ext.has('cloudbeesUser')) {
project.configurations {
deployerJars
}

project.dependencies {
// wagon used to deploy to cloudbees
deployerJars "org.apache.maven.wagon:wagon-webdav:1.0-beta-2"
}

project.uploadArchives {
repositories {
mavenDeployer {
configuration = project.configurations.deployerJars

snapshotRepository(url: "dav:https://repository-zorggemak.forge.cloudbees.com/snapshot/") {
authentication(userName: project.ext.cloudbeesUser, password: project.ext.cloudbeesPassword)
}

repository(url: "dav:https://repository-zorggemak.forge.cloudbees.com/release/") {
authentication(userName: project.ext.cloudbeesUser, password: project.ext.cloudbeesPassword)
}
}
}
}
}

createReleaseTag.dependsOn uploadArchives
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
package org.katta.gradle.plugin.flyway.task

import com.googlecode.flyway.core.Flyway
import com.googlecode.flyway.core.metadatatable.MetaDataTableRow
import com.googlecode.flyway.core.api.MigrationInfo

class StatusTask extends AbstractFlywayTask {

@Override
void executeTask(Flyway flyway) {

MetaDataTableRow metaTableRow = flyway.status()
MigrationInfo info = flyway.info().current()
StringBuilder builder = new StringBuilder("-------------Schema Status------------\n")
builder.append("Version :").append(metaTableRow.getVersion()).append("\n")
.append("Description :").append(metaTableRow.getDescription()).append("\n")
.append("Type :").append(metaTableRow.getMigrationType()).append("\n")
.append("Installed On :").append(metaTableRow.getInstalledOn()).append("\n")
.append("State :").append(metaTableRow.getState())
builder.append("Version :").append(info.getVersion()).append("\n")
.append("Description :").append(info.getDescription()).append("\n")
.append("Type :").append(info.getType()).append("\n")
.append("Installed On :").append(info.getInstalledOn()).append("\n")
.append("State :").append(info.getState())

println builder.toString()
}
Expand Down