Skip to content

Commit

Permalink
Add migration test
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Oct 27, 2023
1 parent 6e01fe6 commit b260095
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/qwc-base-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,20 @@ on: [push]

jobs:

test:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@master

- name: Set up demo database and run migrations
run: |
cd ${GITHUB_WORKSPACE}/test
docker-compose up -d qwc-postgis
docker-compose up --exit-code-from qwc-config-db-migrate
build:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
Expand Down
26 changes: 26 additions & 0 deletions test/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '3.4'


services:

qwc-postgis:
image: sourcepole/qwc-base-db:15 # 15 refers to the Postgres major version
environment:
POSTGRES_PASSWORD: 'uefah5WateiWai1e' # TODO: Set your postgres password here!
volumes:
- ./volumes/db:/var/lib/postgresql/docker
# If you don't want/need the demo data, you can remove this line
- ./volumes/demo-data/setup-demo-data.sh:/docker-entrypoint-initdb.d/2_setup-demo-data.sh
ports:
- "127.0.0.1:5439:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s

qwc-config-db-migrate:
build:
context: ..
dockerfile: Dockerfile.migrate
depends_on:
qwc-postgis:
condition: service_healthy

0 comments on commit b260095

Please sign in to comment.