Skip to content

Commit

Permalink
fix(test-env): enabled flyway clean to run in 'test' environment (#338)
Browse files Browse the repository at this point in the history
Co-authored-by: jimmypalelil <[email protected]>
  • Loading branch information
jimmypalelil and jimmypalelil authored Feb 7, 2025
1 parent 31de967 commit 7a64e15
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions infrastructure/api/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ module "flyway_task" {
},
{
# This defaults to true, though we want to enable it only in dev to reset the database
# also needs an update in migrations/rst/entrypoint.sh file for the flyaway ecs task to run correctly
name = "FLYWAY_CLEAN_DISABLED"
value = contains(["dev", "test"], local.rds_app_env) ? "false" : "true"
}
Expand Down
4 changes: 2 additions & 2 deletions migrations/rst/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ set -e

# Check APP_ENV and run flyway clean if it is set to 'dev'
# FLYWAY_CLEAN_DISABLED will also have to be set to 'false' for this to work
if [ "$APP_ENV" = "dev" ]; then
echo "APP_ENV is set to 'dev'. Running flyway clean..."
if [ "$APP_ENV" = "dev" ] || [ "$APP_ENV" = "test" ]; then
echo "APP_ENV is set to $APP_ENV. Running flyway clean..."
flyway clean
else
echo "APP_ENV is not 'dev'. Skipping flyway clean."
Expand Down

0 comments on commit 7a64e15

Please sign in to comment.