Skip to content

cli: Remove mediatorv1 from rule type commands #1340

cli: Remove mediatorv1 from rule type commands

cli: Remove mediatorv1 from rule type commands #1340

Workflow file for this run

# This test verifies that the docker-compose.yml file is valid and that the
# containers can be started and stopped. It also verifies the database migrations.
name: Compose Migrate test
on:
workflow_call:
pull_request:
branches:
- main
jobs:
docker:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install ko
uses: ko-build/setup-ko@v0.6
- name: Start containers
run: KO_DOCKER_REPO=ko.local make run-docker services="postgres migrate"
- name: Wait for the migrations to complete
timeout-minutes: 1
run: |
set -e
while [ "$(docker logs mediator_migrate_1 | grep 'Database migration completed successfully')" = "" ]; do
sleep 1
done
- name: Check that the database contains the tables found in the migrations folder
run: |
set -e
tables=$(grep -Ri 'CREATE TABLE' database/migrations | sed -E 's/.*CREATE TABLE (IF NOT EXISTS )?(.*) \(/\2/i')
for table in $tables; do
docker exec $(docker ps -a | grep postgres | awk '{print $1}') psql -U postgres -d mediator -c "SELECT * FROM $table"
done