Using Liquibase And Docker with Travis CI
Last updated: July 14, 2025
Many CI/CD tools allow you to deliver changes through your pipeline. Some tools control Liquibase through a plugin and others leverage the Liquibase CLI in a native deployment or a Docker container. This guide contains an example of the Travis CI configuration for running the Liquibase Docker container within your CI/CD Pipeline.
Travis CI is a continuous integration platform, which automates and manages deployments. It supports your development process by automatically building and testing code changes and providing immediate feedback on the success of the change.
Note: For more information, see the Travis CI documentation.
The .travis.yml
file is required for Travis CI to run your pipeline. Use the Liquibase example file, which contains attributes described in the table.
Attribute | Description |
| Represents the language your app uses. |
| Represents your operating system. |
| Allows you to use Docker in your pipeline. |
| Includes global environment variables used to define fields required by Liquibase. |
| Pulls the version of the Liquibase Docker image that you want to use in your pipeline. |
| Includes the |
Before you begin
To use Liquibase and Docker with Travis CI, you needed to:
Ensure that you have a GitHub account.
Note: For more information on how to create a GitHub account, see Signing Up for GitHub.
Procedure
Fork the liquibase-travisci-example repository by selecting the Fork button at the upper-right corner of the liquibase-travisci-example page.
Clone the liquibase-travisci-example repository by running the following in the CLI.
git clone git@github.com:/liquibase/liquibase-travisci-example.git
Create a new git branch for your changes by running.
git checkout -b <your_branch_name>
Edit example/changelogs/samplechangelog.h2.sql to add a new changeset. Replace yourname with a unique identifier.
--changeset yourname:yourname1
--rollback DROP TABLE yourname;
CREATE TABLE yourname (id int PRIMARY key, name varchar(50) NOT NULL,)
Add, commit, and push your changes to GitHub.
git add example/changelogs/samplechangelog.h2.sql
git commit -m "yourname: Adding new changeset for example"
git push origin <your_branch_name>