Passing parameter and values ​​to Gradle Liquibase plugin

I am using the Liquibase gradle plugin ( https://github.com/liquibase/liquibase-gradle-plugin ), but I do not understand how to pass parameters and values.

I want to create a rollback based on the tag and date, but I can only roll back from the tag with this command:

gradle rollback -DliquibaseTag=value 

I do not understand how I should transfer data, tags or score.

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'

}
+4
source share
1 answer

It seems that the syntax may be slightly different from the documented one. Instead, try something like:

gradle rollbackCount -PliquibaseCommandValue=1

+1
source

Source: https://habr.com/ru/post/1615140/


All Articles