Giter Club home page Giter Club logo

ministryofjustice.docker-liquibase's Introduction

Dockerized Liquibase

Docker Pulls Docker Automated build

Build Status Master Branch

This is a Liquibase instance running in a Docker container.

Part of the Open Development Environment Project.

The following drivers have been included:

  • H2 JDBC 1.4.195
  • Oracle JDBC 8 12.2.0.1

Supported tags and respective Dockerfile links

How to run

Query the status of the database

Get the list of changesets to apply considering a database and a changelog to apply

docker run --rm -it -v /path/to/changelog/dir/on/the/host/:/liquibase/changelog/ \
  ferrarimarco/liquibase \
  --driver=oracle.jdbc.OracleDriver \
  --changeLogFile=/liquibase/changelog/changelog-name.yaml \
  --url=jdbc:oracle:thin:@DB_HOST:DB_PORT/DB_NAME \
  --username=DB_USER \
  --password=DB_PW \
  status

Generate a Liquibase diff report

docker run --rm -it ferrarimarco/liquibase \
  --driver=oracle.jdbc.OracleDriver \
  --referenceUrl=jdbc:oracle:thin:@REF_DB_HOST:REF_DB_PORT/REF_DB_NAME \
  --referenceUsername=REF_DB_USER \
  --referencePassword=REF_DB_PW \
  --url=jdbc:oracle:thin:@DB_HOST:DB_PORT/DB_NAME \
  --username=DB_USER \
  --password=DB_PW \
  diff

Generate a Liquibase diff changelog report

docker run --rm -it -v /path/to/changelog/dir/on/the/host/:/liquibase/changelog/ \
  ferrarimarco/liquibase \
  --driver=oracle.jdbc.OracleDriver \
  --changeLogFile=/liquibase/changelog/changelog-name.yaml \
  --referenceUrl=jdbc:oracle:thin:@REF_DB_HOST:REF_DB_PORT/REF_DB_NAME \
  --referenceUsername=REF_DB_USER \
  --referencePassword=REF_DB_PW \
  --url=jdbc:oracle:thin:@DB_HOST:DB_PORT/DB_NAME \
  --username=DB_USER \
  --password=DB_PW \
  diffChangeLog

Note that if you change the --changeLogFile extension to .xml, Liquibase will generate a changelog in XML format.

Apply a changelog to the database

docker run --rm -it -v /path/to/changelog/dir/on/the/host/:/liquibase/changelog/ \
  ferrarimarco/liquibase \
  --driver=oracle.jdbc.OracleDriver \
  --changeLogFile=/liquibase/changelog/changelog-name.yaml \
  --url=jdbc:oracle:thin:@DB_HOST:DB_PORT/DB_NAME \
  --username=DB_USER \
  --password=DB_PW \
  update

Generate a SQL script to update a database (considering its current status) from a changelog

docker run --rm -it -v /path/to/changelog/dir/on/the/host/:/liquibase/changelog/ \
  ferrarimarco/liquibase \
  --driver=oracle.jdbc.OracleDriver \
  --changeLogFile=/liquibase/changelog/changelog-name.yaml \
  --url=jdbc:oracle:thin:@DB_HOST:DB_PORT/DB_NAME \
  --username=DB_USER \
  --password=DB_PW \
  updateSQL

ministryofjustice.docker-liquibase's People

Contributors

ferrarimarco avatar matmoore avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.