Passing parameter and value to Gradle liquibase pl

2020-06-04 11:54发布

I'm using gradle liquibase plugin (https://github.com/liquibase/liquibase-gradle-plugin) but I don't understand how to pass parameters and values.

I want build a rollback based on tag and date but I'm only able to rollback on a tag with this command:

gradle rollback -DliquibaseTag=value 

I don't understand how I should pass data, tag or count.

My grade.build is very simple:

apply plugin: 'liquibase'

buildscript {

    repositories {

          mavenLocal()

      mavenCentral()

    }

    dependencies {

      classpath 'org.liquibase:liquibase-gradle-plugin:1.1.0'

      classpath 'com.h2database:h2:1.3.160'
    }
  }

liquibase {

    activities {

      main {

        changeLogFile 'changelog.xml'

        url 'jdbc:h2:db/liquibase_workshop'

        username 'sa'

        password ''
      } 

    }   
runList = 'main'

}

1条回答
地球回转人心会变
2楼-- · 2020-06-04 12:36

It looks like the syntax may be a little different than documented. Instead try something like:

gradle rollbackCount -PliquibaseCommandValue=1

查看更多
登录 后发表回答