Closed scrain closed 8 years ago
We do this fine in our projects. I have to say we're still on 3.2, but plan to upgrade to the latest version soon.
liquibase {
activities {
def liquibaseScript = 'sql/Release-Migration/Release-Delta.xml'
if (file(liquibaseScript).exists()) {
main {
changeLogFile liquibaseScript
url db
username dbUser
password dbPwd
//driver 'com.microsoft.sqlserver.jdbc.SQLServerDriver'
contexts env
// changeLogParameters([ myToken: 'myvalue', second: 'secondValue'])
// Failed SQL is logged on DEBUG level.
logLevel 'debug'
}
}
}
}
Thanks for the assist @DKroot.
@scrain All of the methods inside an activity block are simply passed on to Liquibase as if they were specified on the command line. So in the above example, the username dbUser
method is the same as --username=dbUser
etc. I've updated the documentation to hopefully avoid future confusion.
Thanks for the insight and quick response.
Does not appear to be any easy way to pass "contexts" through to liquibase using the plugin. I've implemented something similar to what is found here but it seems like it should be more directly supported.
Happy to help with a pull request, but would like to know if a) if there is agreement this should be addressed... and b) what the suggested approach might be.
Thanks