ruby on rails - Engineyard Deployment: How to detect in deployhooks that its the first attempt to execute 'rake db:seed' -
i having trouble detect first attempt of deployment after server instance booted. need run command rake db:seed first time set default users , other details in database. have no idea if possible.
can me please
the best way find out sending --extra-deploy-hook-options while running deployment command , check in after_migrate.rb if config[:initial] present or not. command like
ey deploy -e myapp_staging --config=initial:true after_migrate.rb hook looks like:
on_app_servers if config[:initial] == 'true' $stderr.puts "seeding data" run "cd #{config.release_path}" run "bundle exec rake db:seed" else $stderr.puts "skipping seeding process" end end for more information ey deploy
Comments
Post a Comment