Test data migration with docker


There are several ways how to build docker image : Maven plugins, Gradle plugins, Native docker CLI.

Install docker locally

Windows

https://docs.docker.com/desktop/windows/install/

Linux

Git is installed in the Vagrant


Git is not installed in the Vagrant

Build docker image

Native docker CLI

Go to the root folder of one of the modules and check that file Dockerfile exists. Based on Dockerfile docker image will be build.

For example mod-invoice-storage

Build image : 

docker build -t <hub-user>/<repo-name>[:<tag>]

Example : 

docker build -t testuser/private-repo:mod-invoice-storage-5.2.0-SNAPSHOT.500 .

Push image

  1. Create user in the https://hub.docker.com/ if needed
  2. Login into https://hub.docker.com/ if needed before run push command : docker login
  3. Push
docker push [OPTIONS] NAME[:TAG]

Example :

 docker push testuser/private-repo:mod-invoice-storage-5.2.0-SNAPSHOT.500

Manually pull image into Vagrant box

  1. Run Vagrant box and enter via SSH
  2. Login into https://hub.docker.com/ : sudo docker login
  3. Pull image

docker pull [OPTIONS] NAME[:TAG|@DIGEST]

Example :

sudo docker pull testuser/private-repo:mod-invoice-storage-5.2.0-SNAPSHOT.500

Rename tag

 sudo docker tag testuser/private-repo:mod-invoice-storage-5.2.0-SNAPSHOT.500 docker.ci.folio.org/testuser/private-repo:mod-invoice-storage-5.2.0-SNAPSHOT.500

Note : for success deploy module from docker container mandatory : docker.ci.folio.org/testuser/private-repo

Upgrade module

  1. Old version of the module should be installed. For our example : mod-invoice-storage-5.2.0-SNAPSHOT.499
  2. Assign okapi.all permissions to diku_admin : Add okapi permission to diku_admin.postman_collection.json
  3. Run migration collection for check Migration - MODORDSTOR-248 Tenant migration from Iris-hotfix-3 to Juniper failed.postman_collection.json

Rename "dockerImage" to your path in the Docker Hub in the step "Deploy mod-orders-storage 13.0.3 my docker"

Maven plugins