# liquibase_runner_docker

## Overview
A docker image to run liquibase changelogs.

This repo maintains the ABACUS `liquibase_runner` docker image.

## Usage
The docker image maintained by this repo is used to run migrations against the `royalty_accounting` QA and PROD databases during [deployment](https://pipeline.theorchard.io/job/royalty-accounting-db-deploy/). During QA deployment, migrations are also run against the `royalty_accounting_test` database, which is used for E2E testing.

The image is also used to create a local database when developing against a dockerized dev environment (instead of developing against the QA instance). The dockerized database is used when running a service's functional, integration, and unit tests as well.

The `liquibase_runner_docker` image is used in the following OWS services:
* [lambda-abacus](https://github.com/theorchard/lambda-abacus)
* [ows-abacus-account](https://github.com/theorchard/ows-abacus-account/blob/master/docker-compose.yml)
* [ows-abacus-contract](https://github.com/theorchard/ows-abacus-contract/blob/master/docker-compose.yml)
* [ows-abacus-event](https://github.com/theorchard/ows-abacus-event/blob/master/docker-compose.yml)
* [ows-abacus-state](https://github.com/theorchard/ows-abacus-state/blob/master/docker-compose.yml)
* [ows-ledger](https://github.com/theorchard/ows-ledger/blob/master/docker-compose.yml)
* [ows-payee](https://github.com/theorchard/ows-payee/blob/master/docker-compose.yml)
* [ows-payment](https://github.com/theorchard/ows-payment/blob/master/docker-compose.yml)
* [ows-royalties](https://github.com/theorchard/ows-royalties/blob/master/docker-compose.yml)


## Setup
```shell script
cp .env.shadow .env
```
Add your github deploy token to the .env file

Run tests:
```shell script
make test
```

## Deploy
After merging changes to this repo, manually trigger the [liquibase-runner-docker-to-ecr](https://pipeline.theorchard.io/job/liquibase-runner-docker-to-ecr/) jenkins job. 
