Skip to content

Commit

Permalink
Allow viewing questionnaires in combination with gitlab.com/rikh/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Rik committed Aug 30, 2019
1 parent 82ca845 commit 4a6eda6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
12 changes: 11 additions & 1 deletion lib/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@
# https://stackoverflow.com/a/38732187/1935918

set -e
sleep 10 # wait for the database to be ready

if [ -f /app/tmp/pids/server.pid ]; then
rm /app/tmp/pids/server.pid
fi

bundle exec rake db:migrate 2>/dev/null || bundle exec rake db:setup
cd /app
bundle exec rails i18n:js:export

if [ "$RESET_DB_ON_FAIL" == "true" ]; then
echo resetting db on fail
bundle exec rails db:migrate && bundle exec rails db:seed || { bundle exec rails db:drop && bundle exec rails db:create && bundle exec rails db:migrate && bundle exec rake db:migrate RAILS_ENV=test && bundle exec rails db:seed; }
else
echo not resetting db on fail
bundle exec rails db:migrate && bundle exec rails db:seed || { bundle exec rails db:setup; }
fi

exec bundle exec "$@"
1 change: 1 addition & 0 deletions projects/kct/seeds/teams/kct.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

organization_name = 'Cross-sectional'
organization = Organization.find_by_name(organization_name)
organization ||= Organization.create!(name: organization_name)

puts "Running seeds for #{team_name}"
team = Team.find_by_name(team_name)
Expand Down

0 comments on commit 4a6eda6

Please sign in to comment.