Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanMendicutti committed Aug 24, 2023
1 parent 23ab0dd commit 33f4c29
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 7 additions & 1 deletion bin/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#
# This scipt is executed by Docker on container start on release images (i.e.
# live environments)
puts 'Starting Entrypoint Script'

def set_given_or_default_command
ARGV.concat %w[puma] if ARGV.empty?
Expand All @@ -24,7 +23,14 @@ def run_database_seeds
raise('Seeds failed') unless system('rails db:seed')
end

def load_db
if Rails.env.production? && ENV['DEPLOY_NAME'] == 'production'
Municipality.count.zero? && (bundle exec rake 'data:load')
end
end

set_given_or_default_command
run_migrations
run_database_seeds
load_db
execute_given_or_default_command
4 changes: 0 additions & 4 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,3 @@
#
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
# Character.create(name: 'Luke', movie: movies.first)

if Rails.env.production? && ENV['DEPLOY_NAME'] == 'production'
Municipality.count.zero? && (bundle exec rake 'data:load')
end

0 comments on commit 33f4c29

Please sign in to comment.