-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run rails db:seed in review environment when app starts Updated Dockerfile to use a app startup shell script for that effect
- Loading branch information
1 parent
723149f
commit 0a38c1f
Showing
3 changed files
with
18 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env sh | ||
# | ||
# Dockerfile application startup script | ||
# | ||
|
||
# run migrations | ||
bundle exec rails db:migrate | ||
|
||
# add seed data in review environment | ||
if [ "$RAILS_ENV" = "review" ]; then | ||
echo "Running rails db:seed" | ||
bundle exec rails db:seed | ||
fi | ||
|
||
# start server | ||
bundle exec rails server -b 0.0.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
class EnableOpeningTimes < ActiveRecord::Migration[7.0] | ||
def change | ||
AppSettings.current.update!( | ||
service_start_date: Time.zone.yesterday, | ||
service_end_date: Time.zone.today + 1.year, | ||
) | ||
# Disable this migration and move code into task `rake set_app_settings` | ||
end | ||
end |