Chado icon indicating copy to clipboard operation
Chado copied to clipboard

GitHub workflows to help with review

Open laceysanderson opened this issue 2 months ago • 2 comments

Issue #142

Description

This PR does the following things:

  • [x] Update docker to use the most recent version of Ubuntu + Flybase.
  • [x] Update docker to act on the current directory/branch rather then pulling from github.
  • [x] Create basic Github workflow that will run the flyway migrations.
  • [x] Fix the syntax errors in through V1.3.3.011 migrations that snuck through 🙈
  • [x] Update dockerfile to take PostgreSQL version as an arguement.
  • [x] Matrix the workflow to run migrations on each version of PostgreSQL supported.
  • [x] Create Github Workflow to build docker images and push to github so we can just pull when wanting to test.
  • [x] Update or remove the makefile as it currently operates based on the old dockerfile setup.
  • [x] Update Readme with new docker instructions.

Testing

  1. Confirm the automated testing runs and passes.
  2. Clone this directory locally and test building docker images, running containers and using flyway (more instructions below).
  3. Try pulling the existing images on the container registry and playing with them. See this in the new README here.

When you build the image using the new dockerfile, it actually uses the current code in your Chado clone. In order to allow you to modify the migrations while running the container, you will mount your current directory inside the container using the following approach. This way you can edit the files locally and they will be automatically updated within the container and available to flyway.

git clone https://github.com/GMOD/Chado chado-142-dockerUpgrades
cd chado-142-dockerUpgrades
git checkout 142-github-workflows-to-help-with-review
docker build --tag gmod/chado:local --file docker/Dockerfile \
    --build-arg PGSQL_VERSION=<version> ./
docker run -it -rm --volume=$(pwd):/Chado gmod/chado:local

Replace the <version> with the version of postgresql you want installed. This can be one of 12, 13, 14, 15, or 16; the default is 16 if the build-arg is not specified.

Note: You should not go into the docker directory but rather stay in the root of the clone.

You can test FlyWay migrations by running these flyway commands:

  • See what migrations need to be applied:
flyway info
  • Run the migrations available:
flyway migrate

The migrations have been applied correctly if you do not see any red errors. However, it is good practice to run flyway info again to confirm.

laceysanderson avatar May 02 '24 01:05 laceysanderson