0
votes

We are using Liquibase 3.6.3 version

We are running SQL upgrade scripts using liquibase on the SQL Server Database using liquibase.bat(which we got as part of installation) as below on our local windows machines. This is working as expected.

Command:

liquibase.bat --changeLogFile=..\MasterChangelog.xml --driver==com.microsoft.sqlserver.jdbc.SQLServerDriver --classpath=sqljdbc4-3.0.jar --url="jdbc:sqlserver://;databaseName=MyDB;user=MyUser;password=MyPassword;" --logLevel=INFO update

Now our requirement is to achieve the same through Jenkins as we are currently moving towards AWS.

Questions:

• Do we have any supported liquibase plugins for Jenkins ?

• Do we have any bash supported scripts something which will behave same as liquibase.bat

• Do we have any shell command snippets to execute liquibase scripts on Jenkins?

• Any script snippets so that we can use them in Jenkins pipeline

Is there any other way of achieving this?

2
are you using liquibase inside some java project? If so, liquibase has maven plugin which can be used for that.bilak
Hello Bilak, my aim is to run the Liquibase scripts on Jenkins pipeline as bash script instead of using liquibase.bat file and also i am not allowed to use the Jenkins-Liquibase pluginRaj Kumar Uppala

2 Answers

1
votes

There is a liquibase shell script that ships with liquibase that is equivalent to liquibase.bat.

There is at least one Jenkins plugin for Liquibase - https://wiki.jenkins.io/display/JENKINS/Liquibase+Runner

0
votes

Seems to be this is working for me.

Windows:

liquibase.bat --changeLogFile=..\MasterChangelog.xml --driver==com.microsoft.sqlserver.jdbc.SQLServerDriver --classpath=sqljdbc4-3.0.jar --url="jdbc:sqlserver://;databaseName=MyDB;user=MyUser;password=MyPassword;" --logLevel=INFO update

bash script:

./liquibase --changeLogFile=../MasterChangeLog.xml '--url=jdbc:sqlserver://MyDB;databaseName=MyDB;user=MyUser;password=MyPassword;' --logLevel=INFO update