hwsc-org / hwsc-dev-ops

Resources for managing our services
0 stars 1 forks source link

Bug/bash script does not wait for containers to finish launching #20

Open kimlisa opened 5 years ago

kimlisa commented 5 years ago

Description

Referring to https://github.com/hwsc-org/hwsc-dev-ops/pull/19#discussion_r261021183 for file run_hwsc_user_svc_db.sh in directory db-local-run

Not sure what the specific problem is but it seems the bash script does not wait for containers in the background to finish launching before running migration files resulting in a EOF error

As a temporary work around, sleep 4 was placed to wait for containers to finish launching in the background before running migration

How to Reproduce

remove sleep 4 from the script

Expected Outcome

1: postgres container is launched and running 2: all migrations are successfully executed

Actual Outcome

Postgres container seemed to be launched but rest of script results in EOF error and does not run migration

Work Around

adding sleep 4 after docker run...