Skip to content

Commit

Permalink
fix: Always run "kong migrations up" (#4172)
Browse files Browse the repository at this point in the history
This ensures any missing migration are run and doesn't hurt is there are
none. Non need to run `kong migrations list`

fixes #4171

Signed-off-by: Leonard Goodell <leonard.goodell@intel.com>

Signed-off-by: Leonard Goodell <leonard.goodell@intel.com>
  • Loading branch information
Lenny Goodell committed Sep 29, 2022
1 parent 89bd4a2 commit f2edda9
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,16 @@ export KONG_PG_PASSWORD_FILE
# remove env KONG_PG_PASSWORD: only use KONG_PG_PASSWORD_FILE
unset KONG_PG_PASSWORD

set +e
/docker-entrypoint.sh kong migrations bootstrap
/docker-entrypoint.sh kong migrations list
/docker-entrypoint.sh kong migrations up
/docker-entrypoint.sh kong migrations finish
code=$?
if [ $code -eq 0 ]; then
echo "$(date) kong migrations bootstrap ok, doing migrations up and finish..."
/docker-entrypoint.sh kong migrations up && /docker-entrypoint.sh kong migrations finish
else
if [ $code -ne 0 ]; then
echo "$(date) failed to kong migrations, returned code = " $code
exit $code
fi

set -e
echo "$(date) Configuring Kong Admin API..."

# Running "kong config db_import" will return a non-successful error code even though it
Expand Down

0 comments on commit f2edda9

Please sign in to comment.