Skip to content

Add migration test

Add migration test #39

Workflow file for this run

name: Publish qwc-base-db docker images
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Checkout qwc-docker
uses: actions/checkout@master
with:
repository: qwc-services/qwc-docker
path: qwc-docker
- name: Set up demo database and run migrations
run: |
cd qwc-docker
cp pg_service.conf ~/.pg_service.conf
sed -i 's|host=qwc-postgis|host=localhost|g' ~/.pg_service.conf
sed -i 's|port=5432|port=5439|g' ~/.pg_service.conf
sed -Ei "s|^(\s*POSTGRES_PASSWORD:).*$|\1 'waej7WuoOoth0wor'|" docker-compose-example.yml
docker-compose -f docker-compose-example.yml up -d qwc-postgis
docker run --net="host" -v ~/.pg_service.conf:/tmp/pg_service.conf migrate
build:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@master
- name: Get version tag
id: get_tag
run: |
if [ ${{ endsWith(github.ref, '-lts') }} = true ]; then
echo "tag=latest-lts,${GITHUB_REF:10}" >>$GITHUB_OUTPUT
else
echo "tag=latest,${GITHUB_REF:10}" >>$GITHUB_OUTPUT
fi
- name: Build and publish qwc-base-db docker image for pg 13
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: sourcepole/qwc-base-db
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
tags: "13"
workdir: .
buildargs: PG_MAJOR=13,POSTGIS_VERSION=3
- name: Build and publish qwc-base-db docker image for pg 14
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: sourcepole/qwc-base-db
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
tags: "14"
workdir: .
buildargs: PG_MAJOR=14,POSTGIS_VERSION=3
- name: Build and publish qwc-base-db docker image for pg 15
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: sourcepole/qwc-base-db
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
tags: "15"
workdir: .
buildargs: PG_MAJOR=15,POSTGIS_VERSION=3
- name: Build and publish qwc-base-db-migrate docker image
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: sourcepole/qwc-base-db-migrate
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
tags: "${{ steps.get_tag.outputs.tag }}"
workdir: .
dockerfile: Dockerfile.migrate